Beispiel #1
0
 public async Task Create(ProductoAutores model)
 {
     try
     {
         dbGI.DbSetProductoAutores.Add(model);
         await dbGI.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Beispiel #2
0
        public async Task Update(ProductoAutores model)
        {
            try
            {
                var _model = await dbGI.DbSetProductoAutores.FirstOrDefaultAsync(e => e.Id == model.Id);

                if (_model != null)
                {
                    dbGI.Entry(_model).CurrentValues.SetValues(model);
                    await dbGI.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }