Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

User Export Time Issue #12082


User avatar
0
[email protected] created

We are using Asp.net Zero V 13.2.0 with.NET Core and Angular.

when I have tried to export user, then I got a below error.

An unhandled exception occurred while processing the request. HandlerException: Can't create component 'Demo.EntityFrameworkCore.DemoDbContext' as it has dependencies to be satisfied.

'Demo.EntityFrameworkCore.DemoDbContext' is waiting for the following dependencies:

  • Service 'Microsoft.EntityFrameworkCore.DbContextOptions`1[[Demo.EntityFrameworkCore.DemoDbContext, Demo.EntityFrameworkCore, Version=13.2.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.

12 Answer(s)
  • User Avatar
    0
    [email protected] created

    Hi @ismcagdas,

    would you please check this issue as soon as possible. I am waiting your response.

  • User Avatar
    0
    [email protected] created

    Hi, I am waiting your response. please give me solution as soon as possible.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you share your solution with [email protected] ? We will check the problem as soon as possible.

    Thanks,

  • User Avatar
    0
    [email protected] created

    Hi,

    Could you share your solution with [email protected] ? We will check the problem as soon as possible.

    Thanks,

    any other solution.

  • User Avatar
    0
    ismcagdas created
    Support Team

    This seems like a generic error and we couldn't figure out the error without looking at your code.

  • User Avatar
    0
    [email protected] created

    This seems like a generic error, and we couldn't figure out the error without looking at your code.

    ok. but I have one Question how to implement Tenant wise seed data for Country table?

    is there any examples or documentation for having a separate seed per tenant?

  • User Avatar
    0
    [email protected] created

    This seems like a generic error, and we couldn't figure out the error without looking at your code.

    ok. but I have one Question how to implement Tenant wise seed data for Country table?

    is there any examples or documentation for having a separate seed per tenant?

    Hi ismcagdas,

    please give me Documentation Link, or any other Solution.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In your solution you can take a look at TenantRoleAndUserBuilder and its usage. It is called as shown below;

    new TenantRoleAndUserBuilder(context, 1).Create();

    Basically, you can get list of all tenants and execute the line above with the TenantId.

    foreach(var tenant in tenants){
        new TenantRoleAndUserBuilder(context, tenant.Id).Create();
    }
    
  • User Avatar
    0
    [email protected] created

    Hi,

    In your solution you can take a look at TenantRoleAndUserBuilder and its usage. It is called as shown below;

    new TenantRoleAndUserBuilder(context, 1).Create();

    Basically, you can get list of all tenants and execute the line above with the TenantId.

    foreach(var tenant in tenants){ 
        new TenantRoleAndUserBuilder(context, tenant.Id).Create(); 
    } 
    

    public static class SeedHelper { public static void SeedHostDb(IIocResolver iocResolver) { WithDbContext<lockthreatDbContext>(iocResolver, SeedHostDb); }

     public static void SeedHostDb(lockthreatDbContext context)
     {
         context.SuppressAutoSetTenantId = true;
         //Host seed
         new InitialHostDbBuilder(context).Create();
         //Default tenant seed (in host database).
         new DefaultTenantBuilder(context).Create();
         new TenantRoleAndUserBuilder(context, 1).Create();        
         new TenantOrganizationUnits(context, 1).Create();
         new FacilityTypeBuilder(context, 1).Create();
         new PagesBuilder(context, 1).Create();           
     }
     
    

    How to Get Tenant List Here

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can use context object to retrieve list of Tenants.

  • User Avatar
    0
    [email protected] created

    Hi,

    You can use context object to retrieve list of Tenants.

    Thank you @ismcagdas.

  • User Avatar
    0
    ismcagdas created
    Support Team

    You are welcome :)