KorzhCom / EasyData

Adaptive CRUD for ASP.NET Core. With EasyData you can get both API endpoints and client-side UI for all CRUD operations in a matter of minutes using just your DbContext and a few lines of code.
MIT License
594 stars 63 forks source link

SetIndex method is not functional for reordering attributes #171

Open veyselerCS opened 11 months ago

veyselerCS commented 11 months ago

using SetIndex(int index) method on entity attributes does not result to a correctly reordered set of attributes in EF view. Reordering is done right after the ProcessEntityType method call in DbContextMetaDataLoader but CustomizeModel is called in later stages as far as i understand.

Example usage :

options.UseDbContext<FooContext>(opts => 
{
    opts.CustomizeModel(model =>
    {
        model.Entity<BarEntity>().Attribute(b => b.BazAttribute).SetIndex(<index_to_set);
        //...
    });
}