Пример #1
0
 public Contracts.Vulnerability.VulnerabilityCatalog UpdateCatalog(Contracts.Vulnerability.UpdateVulnerabilityCatalog updateVulnerabilityCatalog)
 {
     using (var db = new RAAPEntities(GetConnectionString()))
     {
         var vulnerabilityCatalog = db.VulnerabilityCatalogs.FirstOrDefault(a => a.VulnerabilityCatalogId == updateVulnerabilityCatalog.VulnerabilityId);
         if (vulnerabilityCatalog == null)
         {
             throw new RAAPNotFoundException("Item not found.");
         }
         vulnerabilityCatalog.ApplyUpdate(updateVulnerabilityCatalog);
         db.SaveChanges();
         return(vulnerabilityCatalog.ToContract());
     }
 }
Пример #2
0
 public static void ApplyUpdate(this VulnerabilityCatalog dataItem, Contracts.Vulnerability.UpdateVulnerabilityCatalog update)
 {
     dataItem.Name = update.Name;
 }