public EntityCollectionAddOrUpdateResponseDto AddOrUpdate(EntityCollectionAddOrUpdateRequestDto request) { var entity = _repository.GetAll() .FirstOrDefault(x => x.Id == request.Id && x.IsDeleted == false); if (entity == null) { _repository.Add(entity = new Models.EntityCollection()); } entity.Name = request.Name; _uow.SaveChanges(); return(new EntityCollectionAddOrUpdateResponseDto(entity)); }
public EntityCollectionDto(Models.EntityCollection entity) { Id = entity.Id; Name = entity.Name; }
public EntityCollectionAddOrUpdateResponseDto(Models.EntityCollection entity) : base(entity) { }