public async Task <OutAppInfoSaveDto> Save(InAppInfoSaveDto input)
        {
            var appId = await _service.Save(input);

            return(new OutAppInfoSaveDto {
                AppId = appId
            });
        }
Ejemplo n.º 2
0
        public async Task <Guid> Save(InAppInfoSaveDto input)
        {
            var appId  = input.AppId ?? Guid.Empty;
            var entity = await _appInfoRepository.FirstOrDefaultAsync(x => x.Id == appId);

            if (input.AppId == null)
            {
                entity = new AppInfo {
                    Id = Guid.NewGuid(), Name = input.Name, Code = input.Code, Descr = input.Descr
                };
                await _appInfoRepository.InsertAsync(entity);
            }
            else
            {
                entity.Name  = input.Name;
                entity.Code  = input.Code;
                entity.Descr = input.Descr;
                await _appInfoRepository.UpdateAsync(entity);
            }
            return(entity.Id);
        }