Esempio n. 1
0
 public IEnumerable <Recipe> GetRecipes()
 {
     try
     {
         using (IRecipeDataGateway dataGateway = dataService.OpenDataGateway())
         {
             return(dataGateway.GetRecipes());
         }
     }
     catch (Exception exception)
     {
         throw new DataSourceBusinessException(exception);
     }
 }
Esempio n. 2
0
 public Recipe FindRecipe(string name)
 {
     try
     {
         using (IRecipeDataGateway dataGateway = dataService.OpenDataGateway())
         {
             return(dataGateway.FindRecipe(name));
         }
     }
     catch (RecipeNotFoundDataException exception)
     {
         throw new RecipeNotFoundBusinessException(name, exception);
     }
     catch (Exception exception)
     {
         throw new DataSourceBusinessException(exception);
     }
 }
Esempio n. 3
0
 public RecipeDataService(IRecipeDataGateway dataGateway)
 {
     this.dataGateway = dataGateway;
 }