public Invoice UpdateInvoice(Invoice invoice) { _context.ArmsInvoices.Update(invoice); _context.Attach(invoice); _context.Entry(invoice).State = EntityState.Modified; _context.SaveChanges(); //_cache.Remove("Invoice"); return(invoice); }
public void DeleteArmsProjectDeliverable(IEnumerable <ArmsProjectDeliverables> projectDeliverables) { foreach (var projDeliverable in projectDeliverables) { ArmsProjectDeliverables armsProjDeliverableToDelete = _mapper.Map <ArmsProjectDeliverables>(projDeliverable); _context.ArmsProjectDeliverables.Update(armsProjDeliverableToDelete); _context.Attach(armsProjDeliverableToDelete); _context.Entry(armsProjDeliverableToDelete).State = EntityState.Deleted; _context.SaveChanges(); } }
//public async Task<List<ConfigItem>> GetAllConfigItemsAsync() //{ // return await _cache.GetOrCreateAsync("Config", entry => // { // return _context.ArmsConfigItems.ToListAsync(); // }); //} public ConfigItem UpdateConfigItem(ConfigItem ci) { _context.ArmsConfigItems.Update(ci); _context.Attach(ci); _context.Entry(ci).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("Config"); return(ci); }
public ControllingBoard UpdateArmsCB(ControllingBoard cb) { _context.ArmsControllingBoards.Update(cb); _context.Attach(cb); _context.Entry(cb).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("CB"); return(cb); }
public Funding UpdateArmsFunding(Funding funding) { _context.ArmsFunding.Update(funding); _context.Attach(funding); _context.Entry(funding).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("Funding"); return(funding); }
public Event UpdateArmsEventType(Event evnt) { _context.ArmsEvents.Update(evnt); _context.Attach(evnt); _context.Entry(evnt).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("Event"); return(evnt); }
public ArmsContribution UpdateArmsContribution(ArmsContribution cb) { _context.ARMSContributions.Update(cb); _context.Attach(cb); _context.Entry(cb).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("CB"); return(cb); }
public FileUpload UpdateArmsEventUploadType(FileUpload upload) { _context.ArmsEventUploads.Update(upload); _context.Attach(upload); _context.Entry(upload).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); _cache.Remove("Upload"); return(upload); }
public ArmsPhase GetArmsArmsPhaseIdAsync(Guid armsPhaseId) { var result = _context.ArmsPhases.FirstOrDefault(a => a.PhaseId == armsPhaseId); if (result != null) { _context.Attach(result); _context.Entry(result).State = EntityState.Detached; } return(result); }