示例#1
0
        //Task<bool> Add(RepositoryCharge newCharge)
        public virtual async Task <bool> Add(RepositoryCharge newCharge)
        {
            await Task.Delay(1);

            Charges entity = new Charges
            {
                Concept     = newCharge.Description,
                Amount      = newCharge.Amount,
                Identifier  = newCharge.identifier,
                DateCreated = DateTime.Now
            };

            chargesContext.Charges.Add(entity);
            chargesContext.SaveChanges();
            return(true);
        }
示例#2
0
 public TEntity Add(TEntity Entity)
 {
     table.Add(Entity);
     _context.SaveChanges();
     return(Entity);
 }