- **ABP Framework version:**6rc3
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): MVC
please reference this question and answer https://support.abp.io/QA/Questions/3634/How-to-use-extra-properites-in-IQueryable
I'm trying to do the same thing, but in a module on a second dbContext. in the primary app module I have this and then I can access the extra property,
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureRole(role =>
{
role.AddOrUpdateProperty<string>("Code", property =>
{
property.Attributes.Add(new RequiredAttribute());
property.Attributes.Add(new StringLengthAttribute(10)
{
MinimumLength = 1
});
});
});
});
however in the module I get this error
System.InvalidOperationException: Translation of 'EF.Property<string>(EntityShaperExpression: Volo.Abp.Identity.IdentityRole ValueBufferExpression: ProjectionBindingExpression: EmptyProjectionMember IsNullable: False , "Code")' failed. Either the query source is not an entity type, or the specified property does not exist on the entity type.
please advise. Thank
3 Answer(s)
-
0
Hi,
I think this is same with https://github.com/abpframework/abp/issues/8019#issuecomment-796776155
Can you check?
-
0
now, this is not the same error. my is
Volo.Abp.Identity.IdentityRole ValueBufferExpression: ProjectionBindingExpression: EmptyProjectionMember IsNullable: False , "Code")' failed. Either the query source is not an entity type, or the specified property does not exist on the entity type.
-
0
Yes, this is not the same error, but there are errors of similar logic. In the startup app module,
StartupModuleDbContext
is configured according to the new property. Still, since this configuration is not done in the dependent module, the dependent moduleModuleDbContext
does not know about the newly added property. In order for it to work as you said, this configuration must be done in the module.
I may not have fully understood the problem. So if you think my observations are wrong, please provide more details.