using Models; using System.Collections.Immutable; namespace LocalEndpoint.Data { // The database interface defines all the different kinds of requests the LocalEndpoint needs to store and retrieve data. public interface Database { public Recipe GetRecipe(Guid id); public RecipeRate GetRecipeRate(Guid user, Guid recipe); public Account? GetAccount(string email, string passwordHash); public void InsertAccount(Account account, string passwordHash); public void InsertRecipe(Recipe recipe); public void InsertUser(User user); public void InsertRate(Guid userId, Guid recipeId, RecipeRate rate); public void RemoveRecipe(Guid id); public ImmutableList ListAllRecipes(); public ImmutableDictionary ListRatesOf(Guid user); } }