public override async Task <UpdateProfessorResponse> UpdateProfessorById(UpdateProfessorRequest request, ServerCallContext context) { _logger.Log(LogLevel.Debug, "Request Received for CollegeGrpcService::UpdateProfessorById"); var updatedProfessor = new UpdateProfessorResponse { Message = "success" }; var professor = new Professor { ProfessorId = Guid.Parse(request.ProfessorId), Name = request.Name, Teaches = request.Teaches, Salary = Convert.ToDecimal(request.Salary), IsPhd = request.IsPhd }; //professor = await _professorsSqlBll.UpdateProfessor(professor) // .ConfigureAwait(false); professor = await _professorsCosmosBll.UpdateProfessor(professor) .ConfigureAwait(false); updatedProfessor.Professor = GetProfessorObject(professor); _logger.Log(LogLevel.Debug, "Returning the results from CollegeGrpcService::UpdateProfessorById"); return(updatedProfessor); }
public async Task <ActionResult> UpdateProfessor([FromBody] Professor professor) { var professorModified = await _professorsCosmosBll.UpdateProfessor(professor); if (professorModified == null) { return(StatusCode(404, $"Unable to find Professor with id {professor.ProfessorId}")); } return(NoContent()); }