예제 #1
0
        public async Task <IHttpActionResult> Put(Guid Userinroleid, [FromBody] Usersinrole model)
        {
            //   if (model.Userinroleid != Userinroleid) return BadRequest("Resource Userinroleid's do not match.");
            //var transactionHeader = Request.Headers.GetValues("TransactionContext");
            //var transactionContext_str = transactionHeader.FirstOrDefault();
            //TransactionContext client_context = JsonConvert.DeserializeObject<TransactionContext>(transactionContext_str);

            //model.TransContext = client_context;
            model.AppendTransactionContext(Request);
            return(await Save(model));
        }
예제 #2
0
        public async Task <IHttpActionResult> Delete(Guid Userinroleid, [FromBody] Usersinrole model)
        {
            // if (model.Userinroleid != Userinroleid) return BadRequest("Resource Userinroleid's do not match.");

            model = await _bl.GetByUserIdRoleId(model.Roleid, model.Userid);

            model.AppendTransactionContext(Request);
            model = await _bl.DeleteAsync(model);

            if (model.Validation.IsValid)
            {
                return(Ok(model));
            }
            CreateModelState(model.Validation);
            return(BadRequest(ModelState));
        }
예제 #3
0
 public async Task <IHttpActionResult> Post([FromBody] Usersinrole model)
 {
     model.AppendTransactionContext(Request);
     return(await Save(model));
 }