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 = _mapper.Map <Professor>(request); /* * // TODO: Technical Debt * 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 _professorsBll.UpdateProfessor(professor); updatedProfessor.Professor = GetProfessorObject(professor); _logger.Log(LogLevel.Debug, "Returning the results from CollegeGrpcService::UpdateProfessorById"); return(updatedProfessor); }
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 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 = _mapper.Map <Professor>(request); professor = await _professorsBll.UpdateProfessor(professor); updatedProfessor.Professor = GetProfessorObject(professor); _logger.Log(LogLevel.Debug, "Returning the results from CollegeGrpcService::UpdateProfessorById"); return(updatedProfessor); }