Delete unnecessary files
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Category
|
||||
{
|
||||
public class CategoryRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Category
|
||||
{
|
||||
public interface ICategoryRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Favorit
|
||||
{
|
||||
public class FavoritRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Favorit
|
||||
{
|
||||
public interface IFavoritRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace FrancescoRecipesWorld.Repositories
|
||||
{
|
||||
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||
|
||||
public interface IIngredientRepository
|
||||
{
|
||||
Task<Ingredient> CreateIngredientToRecipeAsync(int recipeId, string ingredientName);
|
||||
Task UpdateIngredientAsync(Ingredient ingredient);
|
||||
Task<List<Ingredient>> GetIngredientsByRecipeIdAsync(Guid recipeId);
|
||||
Task<List<Recipe>> GetRecipesByIngredientIdAsync(Guid ingredientId);
|
||||
Task<List<Ingredient>> GetIngredientsByNameAsync(string name);
|
||||
Task RemoveIngredientFromRecipeAsync(Recipe recipe, Guid ingredientId);
|
||||
Task<Ingredient> GetIngredientByIdAsync(Guid ingredientId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
namespace FrancescoRecipesWorld.Repositories
|
||||
{
|
||||
using Francesco.Recipes.World.Data;
|
||||
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
|
||||
using Francesco.Recipes.World.Models.BackendModels.Recipe;
|
||||
|
||||
public class IngredientRepository : IIngredientRepository
|
||||
{
|
||||
private readonly FrancescosRecipesWorldDbContext _context;
|
||||
private readonly RecipeRepository _recipeRepository;
|
||||
public IngredientRepository(
|
||||
FrancescosRecipesWorldDbContext context, RecipeRepository recipeRepository)
|
||||
{
|
||||
_context = context;
|
||||
_recipeRepository = recipeRepository;
|
||||
}
|
||||
|
||||
public async Task<Ingredient> CreateIngredientToRecipeAsync(int recipeId, string ingredientName)
|
||||
{
|
||||
var recipe = await _context.Recipes.FindAsync(recipeId);
|
||||
if (recipe == null)
|
||||
{
|
||||
throw new ArgumentException("Recipe not found", nameof(recipeId));
|
||||
}
|
||||
|
||||
var newIngredient = new Ingredient
|
||||
{
|
||||
Name = ingredientName,
|
||||
};
|
||||
_context.Ingredients.Add(newIngredient);
|
||||
await _context.SaveChangesAsync();
|
||||
return newIngredient;
|
||||
}
|
||||
|
||||
public Task RemoveIngredientFromRecipeAsync(Recipe recipe, Guid ingredientId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<Ingredient>> GetIngredientsByNameAsync(string name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<Ingredient>> GetIngredientsByRecipeIdAsync(Guid recipeId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<List<Recipe>> GetRecipesByIngredientIdAsync(Guid ingredientId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task UpdateIngredientAsync(Ingredient ingredient)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<Ingredient> GetIngredientByIdAsync(Guid ingredientId)
|
||||
{
|
||||
var ingredient = await _context.Ingredients.FindAsync(ingredientId);
|
||||
return ingredient ?? throw new InvalidDataException($"Address {ingredientId} not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Instruction
|
||||
{
|
||||
public interface IInstructionsRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Instruction
|
||||
{
|
||||
public class InstructionsRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.MediaFile
|
||||
{
|
||||
public interface IMEdiaFileRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.MediaFile
|
||||
{
|
||||
public class MediaFileRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Recipe
|
||||
{
|
||||
public interface IRecipeRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Recipe
|
||||
{
|
||||
public class RecipeRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.ShoppingLIst
|
||||
{
|
||||
public interface IShoppingListRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.ShoppingLIst
|
||||
{
|
||||
public class ShoppingListRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Unit
|
||||
{
|
||||
public interface IUnitRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Francesco.Recipes.World.Data.Repository.Unit
|
||||
{
|
||||
public class UnitRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user