public void SaveEvent(Repository.Models.Events model) { _context.Events.Add(model); _context.SaveChanges(); _context.ProjectNumbers.Add(model.ProjectNumbers); _context.SaveChanges(); }
public void UpdateEvent(Repository.Models.Events model) { var list = _context.Events.Where(p => p.Id == model.Id).FirstOrDefault(); if (list != null) { _context.Entry(model).State = EntityState.Modified; _context.SaveChanges(); } }
public void Put([FromBody] Repository.Models.Events value) { try { _eventsServices.UpdateEvent(value); } catch (Exception ex) { throw ex; } }