public void Insert(T entity) { if (entity == null) { throw new ArgumentNullException("entity"); } entities.Add(entity); _context.SaveChanges(); }
public IHttpActionResult Post([FromBody] Tasks task) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DBTasks.Add(task); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = task.Quote_ }, task)); }
public void Save() { context.SaveChanges(); }