Base solution for your next web application
Open Closed

There is no implicit reference conversion #4682


User avatar
0
OriAssurant created

I am trying to implement my own AbpUser and AbpUserBase classes instead of using one of the Abp's. I am creating the same classes(AbpUser ,AbpUserBase ) in my application as I need to customize it as per my requirement for User.cs class which implements AbpUser<User>.

But I came across this issue across multiple classes that passes <User> like for example:

public class RoleManager : AbpRoleManager<Role, User>
    {
        public RoleManager(
            RoleStore store,
            IPermissionManager permissionManager,
            IRoleManagementConfig roleManagementConfig,
            ICacheManager cacheManager,
            IUnitOfWorkManager unitOfWorkManager)
            : base(
                store,
                permissionManager,
                roleManagementConfig,
                cacheManager,
                unitOfWorkManager)
        {

        }
    }

I am getting errors like

The type 'Project.project.Authorisations.Users.User' cannot be used as a Type parameter 'TUser' in the generic type or method AbpRoleManager<Role, User>. There is no implicit reference conversion from 'Project.project.Authorisations.Users.User' to 'Abp.Authorisation.Users.AbpUser<Project.project.Authorisations.Users.User>'.

How to resolve this issue?


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @OriAssurant you also need to duplicate RoleManager, UserManager etc... classes for your new user class as well. If you can achieven same goal by modifying the existing User class, it will be easier.