Пример #1
0
        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);
            }
        }
Пример #2
0
 public void Create(TEntity entity)
 {
     Entities.Add(entity);
     context.SaveChanges();
 }
Пример #3
0
 /// <summary>
 /// Saves and finalizes any changes to this repository.
 /// </summary>
 public virtual void SaveChanges()
 {
     _context.SaveChanges();
 }