enkodellc / blazorboilerplate

Blazor Boilerplate / Starter Template with MudBlazor
MIT License
1.87k stars 370 forks source link

Missing CLR Entity Type #462

Closed UrizielTSD closed 3 years ago

UrizielTSD commented 3 years ago

Hey,

I started implementing my own Model, I added the Dto objects too. But whenever I execute the app, i receive the following error with each Entity model I created. Even tho they arent used yet:

Error: System.Exception: Unable to locate metadata resource for: http://localhost:53414/api/data/ ---> System.Exception: Metadata errors encountered: Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'ControlState:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.
Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'Device:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.
Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'DeviceGroup:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.
Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'DeviceState:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.
Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'DeviceType:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.
Metadata mismatch classification: 'Missing CLR Entity Type' - for StructuralType: 'DeviceXRuntypeProfile:#BlazorBoilerplate.Infrastructure.Storage.DataModels'.

Any idea what am I missing here? Thank you

GioviQ commented 3 years ago

You have manually to create DTO in https://github.com/enkodellc/blazorboilerplate/tree/master/src/Shared/BlazorBoilerplate.Shared/Dto/Db

or run https://github.com/enkodellc/blazorboilerplate/tree/master/src/Utils/BlazorBoilerplate.EntityGenerator

UrizielTSD commented 3 years ago

Thats an absolute fantastic helper!

I used the generator to auto re-create my Dtos, now it works

enkodellc commented 2 years ago

This also can happen if you add Models with new Namespaces. The SourceGenerator default namespace is BlazorBoilerplate.Infrastructure.Storage.DataModels. Like Gio said if it is not in that namespace you will have to create your own DTO, or possibly update the SourceGenerator to handle the updated namespaces.