When I run this test:
[TestMethod]
public void AddABogusDealNoLastUpdated()
{
Deal deal = Deal.Create();
deal.LastUpdateUser = "";
//next line should throw verifier error without LastUpdateUser
IdeaBlade.EntityModel.SaveResult result = deal.EntityAspect.EntityManager.SaveChanges();
} |
The [Required] attribute on the LastUpdateUser property doesn't seem to be doing much.
My savehandler does this:
public void DomainModelEntityManager_Saving(object sender, IdeaBlade.EntityModel.EntitySavingEventArgs e)
{
VerifierResultCollection allResults = new VerifierResultCollection();
foreach (Entity item in e.Entities)
{
var itemResults = ((BaseEntity)item).VerifyInstance();
foreach (var result in itemResults) { allResults.Add(result); }
}
if (!allResults.AreOk)
{
e.Cancel = true;
VerifierResults = allResults;
}
} |
I have a verifier that checks something else and it causes the save to be canceled. I had assumed that the [Required] field being empty would be a problem, but instead I get an Oracle error:
IdeaBlade.EntityModel.EntityManagerSaveException: ORA-01400: cannot insert NULL into ("GCSD9"."DEAL"."LAST_UPDATE_USER")
ORA-06512: at line 4 ---> Devart.Data.Oracle.OracleException: ORA-01400: cannot insert NULL into ("GCSD9"."DEAL"."LAST_UPDATE_USER")
ORA-06512: at line 4.
Is there a way to verify that the [Required] fields are populated?