public Invoice AddInvoice(Invoice invoice) { _context.ArmsInvoices.Add(invoice); _context.SaveChanges(); _cache.Remove("Invoice"); return(invoice); }
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 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 async Task <ArmsPhase> AddArmsPhase(ArmsPhase armsPhase) { await _context.ArmsPhases.AddAsync(armsPhase); _context.Attach(armsPhase); _context.Entry(armsPhase).State = EntityState.Added; _context.SaveChanges(); return(armsPhase); }
public ArmsFundingType UpdateArmsArmsFundingType(ArmsFundingType armsFundingType) { _context.ArmsFundingType.Update(armsFundingType); _context.SaveChanges(); _cache.Remove("FundingType"); return(armsFundingType); }
//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 ArmsPersonnel UpdatePersonnel(ArmsPersonnel armsPersonnel) { // _context.ArmsPersonnel.Update(armsPersonnel); // _context.Attach(armsPersonnel); _context.Entry(armsPersonnel).State = EntityState.Modified; _context.SaveChanges(); _cache.Remove("Personnel"); return(armsPersonnel); }
public void AddCustomDeliverable(IEnumerable <ProjDeliverables> projectDeliverables, Guid projId) { if (projectDeliverables != null) { foreach (var projectDeliverable in projectDeliverables) { projectDeliverable.DeliverableId = null; projectDeliverable.UserId = "Manoj"; projectDeliverable.ProjectId = projId; ArmsDeliverables armsDeliverableToAdd = _mapper.Map <ArmsDeliverables>(projectDeliverable); armsDeliverableToAdd.ArmsProjectDeliverables = new List <Entities.ArmsProjectDeliverables>(); /* updating the record in the associated project Deliverables table with foreign key */ armsDeliverableToAdd.ArmsProjectDeliverables.Add(new Entities.ArmsProjectDeliverables { ProjId = projId, UserId = armsDeliverableToAdd.UserId }); _context.ArmsDeliverables.Add(armsDeliverableToAdd); _context.SaveChanges(); } } }
public void CommitChanges() { _context.SaveChanges(); }