public IEnumerable <Recipe> GetRecipes() { try { using (IRecipeDataGateway dataGateway = dataService.OpenDataGateway()) { return(dataGateway.GetRecipes()); } } catch (Exception exception) { throw new DataSourceBusinessException(exception); } }
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); } }
public RecipeDataService(IRecipeDataGateway dataGateway) { this.dataGateway = dataGateway; }