Esempio n. 1
0
        public IHttpActionResult CreateBet([FromBody] CreateBetInsertReq model)
        {
            model.UserId = User.Identity.GetUserId();
            var result = _transactionServices.Create(model);

            // notify all connected clients
            //if(result.Data)
            //    Hub.Clients.All.newBet(model);
            return(ApiHelper.ReturnHttpAction(result, this));
        }
Esempio n. 2
0
        public CRUDResult <bool> Create(CreateBetInsertReq obj)
        {
            #region Clear cache when insert or update
            _cache.Invalidate("InfoRoom");
            #endregion

            var param = new DynamicParameters();
            param.Add("@RoomId", obj.RoomId);
            param.Add("@UserId", obj.UserId);
            param.Add("@AmountBet", obj.AmountBet);
            _repository.Value.Connection.Execute("SP_Bet_Create", param, commandType: CommandType.StoredProcedure);
            return(new CRUDResult <bool>()
            {
                Data = true, StatusCode = CRUDStatusCodeRes.Success
            });
        }