Exemplo n.º 1
0
 public IEnumerable <InputAdvisor> GetInputAdvisorInputs(int inputAdvisorID)
 {
     try
     {
         var                 inputAdvisorParam  = InputAdvisorParameters.GetInputAdvisorIDParameter(projectDBManager, inputAdvisorID);
         DataTable           dtInputAdvisor     = projectDBManager.GetDataTable("SELECT * FROM project.get_input_advisor_inputs_by_id(@input_advisor_id)", CommandType.Text, inputAdvisorParam.ToArray());
         List <InputAdvisor> inputAdvisorInputs = dtInputAdvisor.AsEnumerable()
                                                  .Select(x => new InputAdvisor()
         {
             ProjectID  = x.Field <int>("projectid"),
             ResourceID = x.Field <int>("resourceid"),
             Object     = JObject.Parse(x.Field <string>("object")),
             CreatedBy  = x.Field <string>("createdby")
         }).ToList();
         return(inputAdvisorInputs);
     }
     catch (Exception getInputAdvisorInputException)
     {
         throw new Exception(ExceptionMessages.GET_INPUT_ADVISOR_INPUTS_BY_ID_DATA_ACCESS_ERROR_MSG, getInputAdvisorInputException);
     }
 }