예제 #1
0
 public async Task <int> InsertAsync(TEntity entity)
 {
     //try
     {
         dbSet.Add(entity);
         return(await context.SaveChangesAsync());
     }
     //catch (Exception ex)
     {
         //return -1;
     }
 }
예제 #2
0
        public async Task <int> InsertAsync(ApplicationUser entity)
        {
            try
            {
                entity.AddedDate = DateTime.Now;

                dbSet.Add(entity);
                return(await context.SaveChangesAsync());
            }
            catch (Exception e)
            {
                Log.Error(e, e.Message);
                return(-1);
            }
        }