Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using EduitorNetCore.Models.Database;
- using EduitorNetCore.Models.VOs.Reduceds;
- using EduitorNetCore.Repositories.Database;
- using EduitorNetCore.Repositories.Interfaces;
- using Microsoft.EntityFrameworkCore;
- namespace EduitorNetCore.Repositories
- {
- public class CategoryRepository : Repository<Category>, ICategoryRepository
- {
- public CategoryRepository(DataBaseContext context) : base(context) { }
- public IEnumerable<Category> GetAllIncludeInCategoriesId(IEnumerable<int> categoryIds)
- {
- return Context.Categories.Where(c => categoryIds.Contains(c.Id));
- }
- // we need to use this GetAll method
- public IEnumerable<Category> GetAllWithRelatedEntities() => Context.Categories.Include(c => c.Resources);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement