public async Task <Round> CreateRound([FromBody] RoundCreateModel model)
        {
            var result = await _roundService.InsertRound(model);

            Response.StatusCode = (int)HttpStatusCode.Created;
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Inserts the round.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public async Task <Round> InsertRound(RoundCreateModel model)
        {
            var round = new Round
            {
                Name           = model.Name,
                CompanyId      = model.CompanyId,
                MoneyRaised    = model.PreRoundShares,
                ShareIncreased = model.PostRoundShares,
                RoundDate      = model.TimestampRound,
            };
            var inserted = _roundRepository.Insert(round).Entity;
            await _unitOfWork.CommitAsync();

            return(inserted);
        }
Exemplo n.º 3
0
 public async Task Create(RoundCreateModel model)
 {
     await _gameRoundService.Create(model.Name, model.Duration, model.CopyBy);
 }