This question is locked. New answers and comments are not allowed.
Hello all.
I have a table with computed columns. They are marked as such in the meta data source:
configuration.HasProperty(x => x.EndWeek).WithDataAccessKind(DataAccessKind.ReadOnly).IsNullable();
configuration.HasProperty(x => x.StartWeek).WithDataAccessKind(DataAccessKind.ReadOnly).IsNullable();
configuration.HasProperty(x => x.Duration).WithDataAccessKind(DataAccessKind.ReadOnly).IsNullable();
Performing an update via "AttachCopy" throws an exception.
Telerik.OpenAccess.Exceptions.InvalidOperationException: The update of field
'idee5.Dispatcher.Model.DAL.CalendarEvent.<Duration>k__BackingField'
is
not allowed.
Quellfehler:
Zeile 66:
public
CalendarEventViewModel Update(CalendarEventViewModel updatedObject) {
Zeile 67: CalendarEvent toBeUpdated = _mapper.Map<CalendarEvent>(updatedObject);
Zeile 68: _db.AttachCopy(toBeUpdated);
Zeile 69: _db.SaveChanges();
Zeile 70:
return
updatedObject;
How can I tell DataAccess to handle those computed columns correctly by ignoring changes?
Thanks
Bernd