arche89 arche89 - 1 year ago 516
C# Question

Code generator error: There is no entity type on DbContext

I want to create simple ASP.NET Core App. But when I'm trying to generate API Controller for my model I'm getting following error:
(Screen shots presents code for model class and db context, below is code for EntityBase class)

Setting up code scaffolding properties


public abstract class EntityBase
public int Id { get; set; }
public DateTime Modified { get; set; }
public DateTime Created { get; set; }

public EntityBase()
Created = DateTime.Now;
Modified = Created;

Answer Source

Ok, so I found what was causing this error. I created Many to Many relationship between Convent and Group without using third class. I used to use fluent api to do that.

Thanks all for help!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download