I have a entity that needs an additional property for use in the UI. (ASP.NET FormView with an LLBLGenDataSource2 control).
The concept would be that when the entity is created, I'd like to go to the database and get a value based on some related information. For the sake of this thread, let's say that I am fetching a CustomerEntity and I want to get the most recent OrderId for the customer. That value may or may not exist.
The key thing is that I will need to make a database call to get this data and I want to put that data into an additional field/property that is not part of the base entity (that is, the entity as it exists in the database model).
When the entity is saved, I will be taking some actions based on that value. I am tapping into the PerformWork event on the datasource control so I think that part will not be a problem.
Is there an event on the entity that I can tap into for this? I would need to have access to the entity field values so that I could use criteria from the entity such as the CustomerId.