public async Task <IActionResult> TeacherAssignment( [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "assignment/create")] [RequestBodyType(typeof(TeacherAssignment), "Create/update assignment")] HttpRequest request) { var validateStatus = base.AuthorizationStatus(request); if (validateStatus != System.Net.HttpStatusCode.Accepted) { return(new BadRequestObjectResult(validateStatus)); } string requestBody = await new StreamReader(request.Body).ReadToEndAsync(); TeacherAssignment requestData = JsonConvert.DeserializeObject <TeacherAssignment>(requestBody); await _assignmentService.CreateTeacherAssigments(requestData); return(new OkObjectResult(new { message = "Assignment created successfull." })); }