Exemplo n.º 1
0
        public async Task <ActionResult> Create(ICDDto item)
        {
            ICDDto icd = item;
            await _icdcrudService.Create(icd);

            return(null);
        }
Exemplo n.º 2
0
        public async Task Update(ICDDto dto)
        {
            try
            {
                var entity = await GetEntity(dto.Id);

                using (DHContext db = new DHContext())
                {
                    entity.Code            = dto.Code;
                    entity.Description     = dto.Description;
                    entity.Name            = dto.Name;
                    db.Entry(entity).State = EntityState.Modified;
                    await db.SaveChangesAsync();
                }
            }
            catch (Exception exc)
            {
                _logger.Error($"Failed update ICD {dto.Id} : {exc}");
            }
        }
Exemplo n.º 3
0
 public async Task Create(ICDDto dto)
 {
     try
     {
         using (DHContext db = new DHContext())
         {
             ICD entity = new ICD
             {
                 Id          = Guid.NewGuid(),
                 Code        = dto.Code,
                 Description = dto.Description,
                 Name        = dto.Name
             };
             db.ICDs.Add(entity);
             await db.SaveChangesAsync();
         }
     }
     catch (Exception exc)
     {
         _logger.Error($"Failed create ICD : {exc}");
     }
 }
Exemplo n.º 4
0
        public async Task <ActionResult> Update(ICDDto item)
        {
            await _icdcrudService.Update(item);

            return(null);
        }