Example #1
0
        public async Task <TEntity> Create(TEntity entity)
        {
            Context.Add(entity);

            await Context.SaveChangesAsync();

            return(await GetById(entity.Id));
        }
Example #2
0
 public static void LogGravacao(LogEntity log)
 {
     using (var db = new BWContext())
     {
         try
         {
             db.Add(log);
             db.SaveChanges();
         }
         catch (Exception e)
         {
             throw new Exception(e.Message);
         }
     }
 }