public override RlmCaseIOHistory GetCaseIOHistory(long caseId, long rneuronId, long solutionId) { RlmCaseIOHistory retVal = new RlmCaseIOHistory(); string queryIn = $"SELECT {nameof(_Input)}.[ID] AS Id, {nameof(_Input)}.[Name], {nameof(_Input_Values_Rneuron)}.[Value] FROM {nameof(_Input_Values_Rneuron)} INNER JOIN {nameof(_Input)} ON {nameof(_Input)}.ID = {nameof(_Input_Values_Rneuron)}.Input_ID WHERE Rneuron_ID = @p0;"; string queryOut = $"SELECT {nameof(_Output)}.[ID] AS Id, {nameof(_Output)}.[Name], {nameof(_Output_Values_Solution)}.[Value] FROM {nameof(_Output_Values_Solution)} INNER JOIN {nameof(_Output)} ON {nameof(_Output)}.ID = {nameof(_Output_Values_Solution)}.Output_ID WHERE Solution_ID = @p0;"; using (var conn = GetOpenDBConnection(ConnectionStringWithDatabaseName)) { var resultsIn = conn.Query <RlmCaseInputOutput>(queryIn, new { p0 = rneuronId }); var resultsOut = conn.Query <RlmCaseInputOutput>(queryOut, new { p0 = solutionId }); retVal.Id = caseId; retVal.Inputs = resultsIn.Select(a => { return(a); }).ToList(); retVal.Outputs = resultsOut.Select(a => { return(a); }).ToList(); } return(retVal); }
public RlmCaseIOHistory GetCaseIOHistory(long caseId, long rneuronId, long solutionId) { RlmCaseIOHistory retVal = new RlmCaseIOHistory(); using (RlmDbEntities db = new RlmDbEntities(DatabaseName)) { string queryIn = $"SELECT Inputs.[ID] AS Id, Inputs.[Name], Input_Values_Rneuron.[Value] FROM Input_Values_Rneuron INNER JOIN Inputs ON Inputs.ID = Input_Values_Rneuron.Input_ID WHERE Rneuron_ID = {rneuronId};"; string queryOut = $"SELECT Outputs.[ID] AS Id, Outputs.[Name], Output_Values_Solution.[Value] FROM Output_Values_Solution INNER JOIN Outputs ON Outputs.ID = Output_Values_Solution.Output_ID WHERE Solution_ID = {solutionId};"; var resultsIn = db.Database.SqlQuery <RlmCaseInputOutput>(queryIn); var resultsOut = db.Database.SqlQuery <RlmCaseInputOutput>(queryOut); retVal.Id = caseId; retVal.Inputs = resultsIn.Select(a => { return(a); }).ToList(); retVal.Outputs = resultsOut.Select(a => { return(a); }).ToList(); } return(retVal); }
public RlmCaseIOHistory GetCaseIO(string dbname, long rneuron_id, long solution_id) { RlmCaseIOHistory result = null; try { result = manager.GetCaseInputOutputDetails(new RlmGetCaseIOParams { RlmName = dbname, RneuronId = rneuron_id, SolutionId = solution_id }); } catch (Exception e) { System.Diagnostics.Debug.WriteLine($"Internal error: {e.Message}"); throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.InternalServerError, e)); } return(result); }
public RlmCaseIOHistory GetCaseIOHistory(long caseId, long rneuronId, long solutionId) { RlmCaseIOHistory retVal = rlmDb.GetCaseIOHistory(caseId, rneuronId, solutionId); return(retVal); }