Move Method Body on Repositroy and inject Repository on Service
This commit is contained in:
@@ -17,5 +17,8 @@
|
||||
Task DeleteShoppingListAsync(Guid shoppingListId);
|
||||
|
||||
Task<Recipe?> GetRecipeByNameAndImageAsync(string recipeName, string imageFileName);
|
||||
|
||||
Task<int> GetShoppingListRecipeCountAsync(Guid shoppingListId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,5 +167,12 @@
|
||||
.Include(r => r.MediaFiles.Where(mf => mf.FileName == imageFileName))
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<int> GetShoppingListRecipeCountAsync(Guid shoppingListId)
|
||||
{
|
||||
return await _context.RecipeShoppingLists
|
||||
.Where(rsl => rsl.ShoppingList.Id == shoppingListId)
|
||||
.CountAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user