Beispiel #1
0
 public Contracts.Incident.Incident Update(Contracts.Incident.UpdateIncident updateIncident)
 {
     using (var db = new RAAPEntities(GetConnectionString()))
     {
         var process = db.Incidents.FirstOrDefault(a => a.IncidentId == updateIncident.IncidentId);
         if (process == null)
         {
             throw new RAAPNotFoundException("Item not found.");
         }
         process.ApplyUpdate(updateIncident);
         db.SaveChanges();
         return(process.ToContract());
     }
 }
Beispiel #2
0
 public static void ApplyUpdate(this Incident dataItem, Contracts.Incident.UpdateIncident update)
 {
     dataItem.Name        = update.Name;
     dataItem.Description = update.Description;
     dataItem.UpdatedOn   = DateTime.Now;
 }