public async Task <EstimateView> CreateEstimate(Guid cardHandle, EstimateCreate estimate) { var card = await _dbContext.Cards.FirstAsync(c => c.Handle == cardHandle); var createEntity = new DataModel.Estimate() { Card = card, CreateDateUtc = DateTime.UtcNow, UserName = estimate.UserName, Vote = estimate.Vote }; var created = await _dbContext.Estimates.AddAsync(createEntity); await _dbContext.SaveChangesAsync(); return(_mapper.Map <EstimateView>(created.Entity)); }
public async Task <EstimateView> Vote([FromRoute] Guid cardHandle, [FromBody] EstimateCreate estimate) { return(await _dataAccess.CreateEstimate(cardHandle, estimate)); }
public async Task<EstimateCreate.response> EstimateCreate(EstimateCreate.request request, CancellationToken? token = null) { return await SendAsync<EstimateCreate.response>(request.ToXmlString(), token.GetValueOrDefault(CancellationToken.None)); }