Is there a way to use TypeFinder on Seed?
See original GitHub issueDuring the Seed, the following procedure is executed:
private void CreateRolesAndUsers()
{
//Admin role
var adminRole = _context.Roles.FirstOrDefault(r => r.TenantId == _tenantId && r.Name == StaticRoleNames.Tenants.Admin);
if (adminRole == null)
{
adminRole = _context.Roles.Add(new Role(_tenantId, StaticRoleNames.Tenants.Admin, StaticRoleNames.Tenants.Admin) { IsStatic = true });
_context.SaveChanges();
//Grant all permissions to admin role
var permissions = PermissionFinder
.GetAllPermissions(new AutoMagazineAuthorizationProvider())
.Where(p => p.MultiTenancySides.HasFlag(MultiTenancySides.Tenant))
.ToList();
foreach (var permission in permissions)
{
_context.Permissions.Add(
new RolePermissionSetting
{
TenantId = _tenantId,
Name = permission.Name,
IsGranted = true,
RoleId = adminRole.Id
});
}
_context.SaveChanges();
}
The problem is that “AutoMagazineAuthorizationProvider” dont use static authorizations, it uses TypeFinder to find All classes that implements “IPermissionMapper” like AutoMapper.
IOCManager does not resolve TypeFinder and throw this error “No component for supporting the service Abp.Reflection.ITypeFinder was found”
After I registered manually, i can resolve TypeFinder but it throw an exception when i call Find method .
Value cannot be null. Parameter name: items
using (var tf = IocManager.Instance.ResolveAsDisposable<ITypeFinder>())
{
var list = tf.Object.Find(type=> typeof(IPermissionMapper).IsAssignableFrom(type) && type.IsClass && !type.IsAbstract);
....
}
Is there a way to use TypeFinder on Seed?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Guide to Seedfinding : r/minecraftseeds
Finding seeds starts with imagining the kind of seed you want. Once you have an idea, you can use a seedfinding program or...
Read more >Fast & Free Enneagram Test
The best way to learn your Enneagram type is to start with our personality test above and then explore the different types that...
Read more >Know Your Personality Type and Unleash Your Potential
This test has brief information about the careers for your type, but if you main goal is to find the right career for...
Read more >About the TypeFinder Personality Type Assessment
The TypeFinder is a scientifically validated personality type assessment based upon the theories of Isabel Briggs Myers. The TypeFinder leverages modern ...
Read more >Minecraft Map Finder
Use Chunkbase To Find The Best Minecraft Seeds, and Locate Biomes and Structures By Ritika Pathak Minecraft's map is one of the biggest...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can upgrade to NET Core + EF Core at the same time. Net 461 is not compatible with NET Core related libraries.
Yes. I’m using EF6.
I call seed when execute update-database and when AppWeb Start.
I want to upgrade to EF Core.
Can i use project Net461 with EF Core? I know it is possible but Abp support this? Just changes Abp.EntityFramework to Abp.EntityFrameworkCore, Abp.Zero.EntityFramework to Abp.Zero.EntityFrameworkCore and etc…