Santiago Wirzt
Santiago Wirzt

Reputation: 57

ABP Framework, ConfigureByConvention not defined

I'm following this tutorial https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=NG&DB=EF#map-the-book-entity-to-a-database-table

In that step it instructs me to add b.ConfigureByConvention to the configuration in DbContext but dotnet tells me it is not defined.

I have abp version 5.3.4 and checked that the tutorial is for the correct version. I generated the project with the abp CLI so the packages should not be a problem.

Is there some step that I overlooked?

The complete error is:

'EntityTypeBuilder' does not contain a definition for 'ConfigureByConvention' and no accessible extension method 'ConfigureByConvention' accepting a first argument of type 'EntityTypeBuilder' could be found (are you missing a using directive or an assembly reference?)

Upvotes: 0

Views: 470

Answers (1)

Engincan Veske
Engincan Veske

Reputation: 1585

The ConfigureByConvention method is an extension method, so your IDE probably could not find the related namespace and not suggested to you.

If you add using Volo.Abp.EntityFrameworkCore.Modeling; as namespace then it should work as expected.

Upvotes: 2

Related Questions