public int AddIncidentSettlement(IncidentSettlementDomain incident) { var incidentSettlementDb = new IncidentSettlement().FromDomainModel(incident); _context.IncidentSettlement.Add(incidentSettlementDb); _context.SaveChanges(); return(incidentSettlementDb.IncidentSettlementId); }
public static IncidentSettlementDomain ToDomainModel(this IncidentSettlement obj) { return(obj == null ? null : new IncidentSettlementDomain() { IncidentSettlementId = obj.IncidentSettlementId, Description = obj.Description, FullText = obj.FullText, DateSettled = obj.DateSettled, DateCreated = obj.DateCreated, ModifiedBy = obj.ModifiedBy, DateModified = obj.DateModified, TenantId = obj.TenantId, IncidentStatusId = obj.IncidentStatusId }); }
public static IncidentSettlement FromDomainModel(this IncidentSettlement obj, IncidentSettlementDomain domain) { if (obj == null) { obj = new IncidentSettlement(); } obj.IncidentSettlementId = domain.IncidentSettlementId; obj.Description = domain.Description; obj.FullText = domain.FullText; obj.DateSettled = domain.DateSettled; obj.DateCreated = domain.DateCreated; obj.ModifiedBy = domain.ModifiedBy; obj.DateModified = domain.DateModified; obj.TenantId = domain.TenantId; obj.IncidentStatusId = domain.IncidentStatusId; return(obj); }