public async Task <StoreDto> Handle(CreateStoreCommand command, CancellationToken cancellationToken) { var store = new Store.Domain.Store { Name = command.Name, Location = command.Location }; await _storeRepository.AddAsync(store, cancellationToken); return(_mapper.Map <StoreDto>(store)); }
public async Task <StoreDto> Handle(CreateStoreCommand command, CancellationToken cancellationToken) { var store = new Store.Domain.Store { Name = command.Name, Location = command.Location }; var entity = await _dbContext.Set <Store.Domain.Store>().AddAsync(store, cancellationToken); return(_mapper.Map <StoreDto>(entity.Entity)); }