first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Fitness_core_BE.Interfaces;
|
||||
using Fitness_core_BE.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Fitness_core_BE.Repos
|
||||
{
|
||||
public class NavItemRepository : INavItemRepository
|
||||
{
|
||||
private readonly CentralDbContext _context;
|
||||
|
||||
public NavItemRepository(CentralDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<List<NavItem>> GetActiveNavItemsOrdered()
|
||||
{
|
||||
return await _context.NavItems
|
||||
.AsNoTracking()
|
||||
.Where(n => n.IsActive)
|
||||
.OrderBy(n => n.SortOrder)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user