public async Task <CobSysfile> Insert(CobSysfile cobSysfile)
        {
            await _unitOfWork.CobSysfileRepository.Add(cobSysfile);

            await _unitOfWork.SaveChangesAsync();

            return(cobSysfile);
        }
        public async Task <CobSysfile> Update(CobSysfile cobSysfile)
        {
            var sysfile = await GetById(cobSysfile.Id);

            if (sysfile == null)
            {
                throw new Exception("Registro No existe");
            }

            _unitOfWork.CobSysfileRepository.Update(sysfile);
            await _unitOfWork.SaveChangesAsync();

            return(await GetById(cobSysfile.Id));
        }
Пример #3
0
        public async Task Delete(short id)
        {
            CobSysfile entity = await GetById(id);

            _context.CobSysfile.Remove(entity);
        }
Пример #4
0
 public void Update(CobSysfile entity)
 {
     _context.CobSysfile.Update(entity);
 }
Пример #5
0
 public async Task Add(CobSysfile entity)
 {
     await _context.CobSysfile.AddAsync(entity);
 }