using AutoLot.Dal.EfStructures;
using AutoLot.Dal.Models.Entities;
using AutoLot.Dal.Repos.Base;
using AutoLot.Dal.Repos.Interfaces;
using Microsoft.EntityFrameworkCore;
Измените класс на public
BaseRepo, реализуйте ICreditRiskRepo и добавьте два обязательных конструктора:namespace AutoLot.Dal.Repos
{
public
{
public CreditRiskRepo(ApplicationDbContext context) : base(context)
{
}
internal CreditRiskRepo(
DbContextOptions
: base(options)
{
}
}
}
Хранилище данных о заказчиках
Откройте файл класса CustomerRepo.cs
using:using System.Collections.Generic;
using System.Linq;
using AutoLot.Dal.EfStructures;
using AutoLot.Dal.Models.Entities;
using AutoLot.Dal.Repos.Base;
using AutoLot.Dal.Repos.Interfaces;
using Microsoft.EntityFrameworkCore;
Измените класс на public
BaseRepo, реализуйте ICustomerRepo и добавьте два обязательных конструктора:namespace AutoLot.Dal.Repos
{
public
{
public CustomerRepo(ApplicationDbContext context)
: base(context)
{
}
internal CustomerRepo(
DbContextOptions
: base(options)
{
}
}
}
Наконец, добавьте метод, который возвращает все записи Customer
LastName:public override IEnumerable
=> Table
.Include(c => c.Orders)
.OrderBy(o => o.PersonalInformation.LastName);
Хранилище данных о производителях
Откройте файл класса MakeRepo.cs
using:using System.Collections.Generic;
using System.Linq;
using AutoLot.Dal.EfStructures;
using AutoLot.Dal.Models.Entities;
using AutoLot.Dal.Repos.Base;
using AutoLot.Dal.Repos.Interfaces;
using Microsoft.EntityFrameworkCore;
Измените класс на public
BaseRepo, реализуйте IMakeRepo и добавьте два обязательных конструктора:namespace AutoLot.Dal.Repos
{
public
{
public MakeRepo(ApplicationDbContext context)
: base(context)
{
}
internal MakeRepo(
DbContextOptions
: base(options)
{
}
}
}
Переопределите методы GetAll()
Make по названиям:public override IEnumerable
=> Table.OrderBy(m => m.Name);
public override IEnumerable
=> Table.IgnoreQueryFilters().OrderBy(m => m.Name);
Хранилище данных о заказах
Откройте файл класса OrderRepo.cs
using:using AutoLot.Dal.EfStructures;
using AutoLot.Dal.Models.Entities;
using AutoLot.Dal.Repos.Base;
using AutoLot.Dal.Repos.Interfaces;
using Microsoft.EntityFrameworkCore;
Измените класс на public
BaseRepo и реализуйте IOrderRepo:namespace AutoLot.Dal.Repos
{
public
{
public OrderRepo(ApplicationDbContext context)
: base(context)
{
}
internal OrderRepo(
DbContextOptions
: base(options)
{
}
}
}