示例#1
0
 public string GetWwtpNameForId(int id)
 {
     try
     {
         return(_dbViewAccessor.GetWaterPlants().FirstOrDefault(x => x.waterPlantId == id).waterPlantName);
     }
     catch (Exception e)
     {
         throw new Exception($"Could not retreive the wastewater treatment plant name for the id [{id}]");
     }
 }
示例#2
0
 public List <vWaterPlant> GetWaterPlants()
 {
     try
     {
         var result = _dbAccessor.GetWaterPlants();
         return(result.ToList());
     }
     catch (Exception e)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, $"Data could not be retreived. Reason: {e.Message}");
     }
 }