This question is locked. New answers and comments are not allowed.
In the past we updated 2 properties on savechanges (lastUpdate (datetime) and LastStaffID (Guid)) but i can't seem to find out how i can manage this with DataAccess, only found a 1 field option so far.
Any suggestion on how i can achieve this?
example of how it was :
foreach (Entity item in e.Entities)
{
if (item.EntityAspect.EntityState == EntityState.Modified)
{
try
{
item.EntityAspect.EntityMetadata.DataProperties["LastUpdate"].SetValue(item, DateTime.Now);
item.EntityAspect.EntityMetadata.DataProperties["LastStaffID"].SetValue(item, Guid.Empty);
}
catch (Exception)
{ ; }
}
}
Any suggestion on how i can achieve this?
example of how it was :
foreach (Entity item in e.Entities)
{
if (item.EntityAspect.EntityState == EntityState.Modified)
{
try
{
item.EntityAspect.EntityMetadata.DataProperties["LastUpdate"].SetValue(item, DateTime.Now);
item.EntityAspect.EntityMetadata.DataProperties["LastStaffID"].SetValue(item, Guid.Empty);
}
catch (Exception)
{ ; }
}
}