New Posts New Posts RSS Feed: Verify Navigation Properties
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Verify Navigation Properties

 Post Reply Post Reply
Author
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Topic: Verify Navigation Properties
    Posted: 20-Oct-2011 at 12:34pm
Hi CaptainOrgange,
 
You could execute the verifier engine against the Person as well:
 
VerifierEngine.Execute(aCar)
VerifierEngine.Execute(aCar.Person)
 
Regards,
   Silvio
Back to Top
CaptainOrgange View Drop Down
Newbie
Newbie


Joined: 05-Oct-2011
Posts: 4
Post Options Post Options   Quote CaptainOrgange Quote  Post ReplyReply Direct Link To This Post Posted: 20-Oct-2011 at 4:08am
Hi.
 
I am trying to verify my properties before calling the Save method. I do this be ensuring the the object belongs to the EntotyManager, then I call the VerifierEngine.Execute() method. This works great for entities having no navigation properties.
 
As an example. I have a Person model, and a Car model. My Person model can have allot of cars,and a Car can only have one Person, i.e. The Person is a Navigation Property for the Car Model. 
Now I want to have a quick admin screen, where you type the person name,surname and the car make and model. Then the application should save the Car and the Person. This I got working. But now I want to validate before the EntityManager.Save is called, how can I do this.
 
When I try to validate the Car is validated //** VerifierEngine.Execute(instance of car) **/, but the Person properties is not verified. But when I call EntityManager.SaveChanges, then the Person is validated, i want to do this before the save.
 
Any ideas welcome
 
 

 



Edited by CaptainOrgange - 20-Oct-2011 at 4:12am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down