26 lines
649 B
C#
26 lines
649 B
C#
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();
|
|
}
|
|
}
|
|
}
|