コード例 #1
0
 public List <vTreatmentStep> GetTreatmentSteps([FromUri] int waterPlantId)
 {
     try
     {
         var result = _dbAccessor.GetTreatmentSteps().Where(x => x.waterPlantId == waterPlantId);
         return(result.ToList());
     }
     catch (Exception e)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, $"Data could not be retreived. Reason: {e.Message}");
     }
 }
コード例 #2
0
 public bool TreatmentStepTypeForWwtpExists(string treatmentType, string wwtpName)
 {
     try
     {
         var result = _dbViewAccessor.GetTreatmentSteps().FirstOrDefault(x =>
                                                                         x.treatmentStepTypeName == treatmentType && x.waterPlantName == wwtpName);
         return(result != null);
     }
     catch (Exception e)
     {
         throw new Exception($"Could not check if treatment step type [{treatmentType}] exists for the waterplant with name [{wwtpName}]");
     }
 }