| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // ======================================
- // Author: Ebenezer Monney
- // Email: info@ebenmonney.com
- // Copyright (c) 2017 www.ebenmonney.com
- //
- // ==> Gun4Hire: contact@ebenmonney.com
- // ======================================
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.EntityFrameworkCore;
- using DAL.Models;
- using DAL.Repositories.Interfaces;
- namespace DAL.Repositories
- {
- public class CustomerRepository : Repository<Customer>, ICustomerRepository
- {
- public CustomerRepository(ApplicationDbContext context) : base(context)
- { }
- public IEnumerable<Customer> GetTopActiveCustomers(int count)
- {
- throw new NotImplementedException();
- }
- public IEnumerable<Customer> GetAllCustomersData()
- {
- return appContext.Customers
- .Include(c => c.Orders).ThenInclude(o => o.OrderDetails).ThenInclude(d => d.Product)
- .Include(c => c.Orders).ThenInclude(o => o.Cashier)
- .OrderBy(c => c.Name)
- .ToList();
- }
- private ApplicationDbContext appContext
- {
- get { return (ApplicationDbContext)_context; }
- }
- }
- }
|