public async Task <CreateLeventamentoResponse> Handle(CreateLevantamentoCommand request, CancellationToken cancellationToken) { var levantamento = new Domain.AggregatesModel.LevantamentoAggregate.Levantamentos(request.Name, request.Description, request.Start); await _levantamentoRepository.AddLevantamentoAsync(levantamento); if (await _levantamentoRepository.UnitOfWork.SaveEntitiesAsync()) { return(new CreateLeventamentoResponse { Id = levantamento.Id, Name = levantamento.Name, Description = levantamento.Description, StartedAt = levantamento.Start }); } return(new CreateLeventamentoResponse()); }
public Task UpdateLevantamentoAsync(Domain.AggregatesModel.LevantamentoAggregate.Levantamentos levantamento) { _context.Entry(levantamento).State = EntityState.Modified; return(Task.CompletedTask); }
public async Task UpdateLevantamentoAsync(Domain.AggregatesModel.LevantamentoAggregate.Levantamentos levantamento) { await _context.Update(db, levantamento, x => x.Id == levantamento.Id); }
public Task AddLevantamentoAsync(Domain.AggregatesModel.LevantamentoAggregate.Levantamentos levantamento) { return(_context.Levantamento.AddAsync(levantamento)); }
public async Task AddLevantamentoAsync(Domain.AggregatesModel.LevantamentoAggregate.Levantamentos levantamento) { await _context.Add(db, levantamento); }