I am using Domain Services and Entity Framework. EF has account entity with 4 fields, ID,Name,Age, MyLogic
in My sample XAML file:
i have 3 fields for example ID, NAME,AGE.
While inserting and updating data, i have 3 values on XAML file and i need to insert custom logic into 4rth field. like
MyLogic= Name-Age-ID( new auto generated id from database)= eg Adam-58-NewPKValue
What is best practice to solve it. Thanks,
R
There are several ways to implement a 'pseudo' property (i.e., a value that is not stored in the database, but computed from other values instead). If you are using the MVVM pattern, you can bind the field on the data form to a notifying property in your ViewModel.
In order for the dataform to be in synch, the mutators for your other three properties would have to invoke the setter of your 'pseudo' property. So that, for example, when the user changed the Name, the NameAgeId property would be simultaneously updated.