コード例 #1
0
 public async Task Create(InformeBecario model)
 {
     try
     {
         _db.dbSetInformeBecario.Add(model);
         await _db.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
コード例 #2
0
        public async Task Update(InformeBecario model)
        {
            try
            {
                var _model = await _db.dbSetInformeBecario.FirstOrDefaultAsync(e => e.InformeBecarioId == model.InformeBecarioId);

                if (_model != null)
                {
                    _db.Entry(_model).CurrentValues.SetValues(model);
                    await _db.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
コード例 #3
0
        public async Task UpdateEstado(InformeBecario model)
        {
            try
            {
                var _model = await _db.dbSetInformeBecario.FirstOrDefaultAsync(e => e.InformeBecarioId == model.InformeBecarioId);

                if (_model != null)
                {
                    _model.Estado = model.Estado;
                    await _db.SaveChangesAsync();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }