public bool AddTask(DealTask task) { try { Item item = MyMapper.Map <Item>(task); efContext.DealTasks.Add(item); int affected = efContext.SaveChanges(); return(affected == 1); } catch (Exception) { return(false); } }
public void Create(TEntity entity) { Entities.Add(entity); context.SaveChanges(); }
/// <summary> /// Saves and finalizes any changes to this repository. /// </summary> public virtual void SaveChanges() { _context.SaveChanges(); }