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

            Response.StatusCode = (int)HttpStatusCode.Created;
            return(result);
        }
Beispiel #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);
        }
 public async Task Create(RoundCreateModel model)
 {
     await _gameRoundService.Create(model.Name, model.Duration, model.CopyBy);
 }