public CheckListItemAddOrUpdateResponseDto AddOrUpdate(CheckListItemAddOrUpdateRequestDto request)
        {
            var entity = _repository.GetAll()
                         .FirstOrDefault(x => x.Id == request.Id && x.IsDeleted == false);

            if (entity == null)
            {
                _repository.Add(entity = new Models.CheckListItem());
            }
            entity.Name = request.Name;
            _uow.SaveChanges();
            return(new CheckListItemAddOrUpdateResponseDto(entity));
        }
 public CheckListItemDto(Models.CheckListItem entity)
 {
     Id   = entity.Id;
     Name = entity.Name;
 }
Beispiel #3
0
 public CheckListItemAddOrUpdateResponseDto(Models.CheckListItem entity)
     : base(entity)
 {
 }