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)); }
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)); }
public async Task <IHttpActionResult> Post([FromBody] Usersinrole model) { model.AppendTransactionContext(Request); return(await Save(model)); }