Creating a module. Db context error
See original GitHub issueHi,
I am implementing module and using blog-module as example. Also I know about todo-module and that was made as example for issue aspnetboilerplate/aspnetboilerplate#1476. As I understood, todo-module is fully independent from main abp app (template). Is it right? But I need to use one db and auth stuff within all my modules and template, it is why I use blog-module as sample. I created module, but stucking with db context. There is my db context:
`[AutoRepositoryTypes(
typeof(IFttRepository<>),
typeof(IFttRepository<,>),
typeof(FttRepositoryBase<>),
typeof(FttRepositoryBase<,>)
)]
public class FttDbContext : AbpZeroDbContext<FttTenant, FttRole, FttUser, FttDbContext>
{
public FttDbContext(DbContextOptions<FttDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
}`
ERROR: CS0311: The type 'DigitalFactory.FTT.Core.Auth.FttRole' cannot be used as type parameter 'TRole' in the generic type or method 'AbpZeroDbContext<TTenant, TRole, TUser, TSelf>'. There is no implicit reference conversion from 'DigitalFactory.FTT.Core.Auth.FttRole' to 'Abp.Authorization.Roles.AbpRole<DigitalFactory.FTT.Core.Auth.FttUser>'
The same error for FttUser
. The FttTenant
is ok. Declarations of FttUser
and FttRole
are same as in example and derived from AbpUser<FttUser>
and AbpRole<FttUser>
.
Could you help me to resolve this please? Is it possible to keep auth stuff (user, role, tenant, stores, managers) on separate module? Going to create library (not module) that will be referenced by all my modules.
I use Core template, not .Net
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@prodenx found the problem, it seems like you were using (it is net461):
<PackageReference Include="Abp.Zero.EntityFrameworkCore" Version="4.1.0" />
instead you need to use:
<PackageReference Include="Abp.ZeroCore.EntityFrameworkCore" Version="4.1.0" />
And depend on
AbpZeroCoreEntityFrameworkCoreModule
instead ofAbpZeroEntityFrameworkCoreModule
in DigitalFactoryFTTEntityFrameworkCoreModule.cs.@ismcagdas Thanks a lot. Works. I missed with naming. My bad.
Thanks