Entity Framework Question

Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
Hi,

Using EF5, how would I update a property of an Entity based on the value of the property of another Entity?

So for example, I have a Project & Tasks application (a project can have many tasks) and I want the Project to display whether it's On Target or not based on the status of it's related tasks.

Do I just need to override the setter for the Tasks property to update the related Project property if required, or is there a better way to do this?

Hope I've given enough details!

Thanks,
 
Soldato
Joined
27 Mar 2003
Posts
2,710
Is this a property that is being saved back to storage or just something you need on the fly (e.g just then) if you don't need storage then just have a property with a getter that computes the appropriate status based on the rules you have for the tasks. This is assuming that the collection of tasks is a property within your model where you have this property.
 
Back
Top Bottom