コード例 #1
0
 public ResponseItem <Contracts.Api.Game> Put(Contracts.Api.Game item)
 {
     return(new ResponseItem <Contracts.Api.Game>(ResultCodeEnum.Success)
     {
         Data = item
     });
 }
コード例 #2
0
 public ResponseItem <Contracts.Api.Game> Post(Contracts.Api.Game resource)
 {
     return(new ResponseItem <Contracts.Api.Game>(ResultCodeEnum.Success)
     {
         Data = resource
     });
 }
コード例 #3
0
        public ResponseItem <Contracts.Api.Game> Put(string id, Contracts.Api.Game item)
        {
            if (id.ToLower().Contains("error"))
            {
                return(new ResponseItem <Contracts.Api.Game>(ResultCodeEnum.GeneralFailure)
                {
                    Errors = new List <string>()
                    {
                        "General Error Simulated"
                    }
                });
            }

            if (id.ToLower().Contains("exception"))
            {
                throw new BadRequestException();
            }

            return(new ResponseItem <Contracts.Api.Game>(ResultCodeEnum.Success)
            {
                Data = item
            });
        }