예제 #1
0
 public void Insert(T entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     entities.Add(entity);
     _context.SaveChanges();
 }
예제 #2
0
 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));
 }
예제 #3
0
 public void Save()
 {
     context.SaveChanges();
 }