private void SaveDetail(IUnitOfWork uow, Row detail, object masterId, object detailId) { detail = detail.Clone(); foreignKeyField.AsObject(detail, masterId); if (!ReferenceEquals(null, filterField)) filterField.AsObject(detail, filterValue); ((Field)((IIdRow)detail).IdField).AsObject(detail, detailId); var saveHandler = saveHandlerFactory(); var saveRequest = saveRequestFactory(); saveRequest.Entity = detail; saveHandler.Process(uow, saveRequest, detailId == null ? SaveRequestType.Create : SaveRequestType.Update); }
private void SaveDetail(IUnitOfWork uow, Row detail, Int64 masterId, Int64? detailId) { detail = detail.Clone(); ((IIdRow)detail).IdField[detail] = detailId; ((IIdField)foreignKeyField)[detail] = masterId; var saveHandler = saveHandlerFactory(); var saveRequest = saveRequestFactory(); saveRequest.Entity = detail; saveHandler.Process(uow, saveRequest, detailId == null ? SaveRequestType.Create : SaveRequestType.Update); }