I am getting this error in identitydbcontext in repository model design

50 Views Asked by At

I get this error in the IdentityDbContext in the warehouse model design. I couldn't find anything in the Microsoft documentation. Can you help me? I'm using ASP.NET Core 8.

Severity Code Description Project File Line Suppression State Error CS0311 The type 'Carebook.Dal.Concrete.EntityFramework.Conetext.AppDbContext' cannot be used as type parameter 'TContext' in the generic type or method 'EfEntityRepositoryBase<TEntity, TContext>'. There is no implicit reference conversion from 'Carebook.Dal.Concrete.EntityFramework.Conetext.AppDbContext' to 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext'. Carebook.Dal C:\Users\ASUS\Source\Repos\CarebookProject\Carebook.Dal\Concrete\EntityFramework\EfCareDal.cs 17 Active

enter image deenter code herescription here

What is the source of the error and how can I solve it?

  namespace Carebook.Dal.Concrete.EntityFramework
{
    public class EfCareDal: EfEntityRepositoryBase<Car,AppDbContext>,ICarDal
    {


    }
  public class AppDbContext : IdentityDbContext<User, Role, int>
  {
      public AppDbContext(DbContextOptions options)
        : base(options)
      {

      }
      protected override void OnModelCreating(ModelBuilder builder)
      {
          builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
          base.OnModelCreating(builder);
      }

      public virtual DbSet<Car> Cars { get; set; }
      public virtual DbSet<CarPicture> CarPictures { get; set; }
      public virtual DbSet<Feature> Features { get; set; }
      public virtual DbSet<Reservation> Reservations { get; set; }
      public virtual DbSet<Pricing> Pricings { get; set; }
      public virtual DbSet<Contact> Contacts { get; set; }
  }
0

There are 0 best solutions below