Activities of "gterdem"

You don't need to replace DbContext since you are not merging dbcontexts etc.

Just using concrete implementation <br>

public override void ConfigureServices(ServiceConfigurationContext context)
{
    context.Services.AddAbpDbContext<EmployeeManagementServiceDbContext>(options =>    {
        ...
    });
}

should be fine.

Can you share EmployeeManagementServiceDbContext and connection strings under appsettings.json of your Api.Host project?

protected override void OnModelCreating(ModelBuilder builder)
    {
    base.OnModelCreating(builder);
    */ Configure the shared tables (with included modules) here */
    builder.Entity<AppUser>(b =>
    {
        b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser

        b.ConfigureByConvention();
        b.ConfigureAbpUser();

        /* Configure mappings for your additional properties.
         * Also see the EducationCloudEfCoreEntityExtensionMappings class.
         */
    });


    builder.Entity<AppOrganizationUnit>(b =>
    {
        b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "OrganizationUnits");
       // b.ConfigureByConvention();

        //b.ConfigureExtraProperties();
        ////b.Ignore(x => x.ExtraProperties);
        //b.Property(x => x.OrgCode);
        //b.HasMany<OrganizationUnitRole>();
    });
    // add this..
    //builder.Entity<OrganizationUnit>(b =>
    //{
    //    b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "OrganizationUnits");

    //    b.ConfigureByConvention();

    //    b.Property(ou => ou.Code).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxCodeLength)
    //        .HasColumnName(nameof(OrganizationUnit.Code));
    //    b.Property(ou => ou.DisplayName).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxDisplayNameLength)
    //        .HasColumnName(nameof(OrganizationUnit.DisplayName));

    //    b.HasMany<OrganizationUnit>().WithOne().HasForeignKey(ou => ou.ParentId);
    //    b.HasMany(ou => ou.Roles).WithOne().HasForeignKey(our => our.OrganizationUnitId).IsRequired();

    //    b.HasIndex(ou => ou.Code);
    //});

    //builder.Ignore<OrganizationUnitRole>();

    /* Configure your own tables/entities inside the ConfigureEducationCloud method */

    builder.ConfigureEducationCloud();
}

If you map extra properties to efcore, you need to configure them at OnModelCreating**.** Add .ConfigureByConvention() and .ConfigureExtraProperties().

Since Identity Module uses Microsoft Identity, you should be able to set it in IdentityOptions like: <br>

Configure<IdentityOptions>(options =>
{
    options.User.RequireUniqueEmail = false;
});

I think it depends on your case.

If you want to use it in your application service only, you can define in .Application layer. If you want to use it in domain events; create in .Domain layer. It's up to which layer you want to choose to be depended on Background Jobs.

If you check the Module Architecture docs, creating the Background Job in Domain layer makes it available to your whole solution since it will be depended in the core domain.

Glad to hear your problem solved. Closing the issue, feel free to create a new one whenever you have a new question.

Answer

2021-05-06 07:35:00.588 -04:00 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name IdenityManager Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration)

I don't think it is related with AzureAD. It seems it is about /health-status URI error. Can it be related with the name IdenityManager Health Status typo? Did you mean IdentityManager?

Answer

Hello Maliming,

As per your reply, I tried giving reference of FD.Demo.EntityFrameworkCore.csproj to my FD.Demo.Microservice.Host project but I am still getting the same error. Can we please schedule a call?

Can you double check if you add the DependsOn attribute in the FDDemoMicroserviceHostModule as well?

Hello,

You need to replace .EntityFrameworkCore project with .MongoDB project and update the related dependencies.

To use auto-migration, update connection string located in your microservice host.api appsettings.json. Check Database Migrations docs to understand which connection strings are used for.

Answer

When I deploy to the production environment, this problem still exists

2021-04-23 09:26:14.799 +00:00 [ERR] Connection id "0HM867749Q1JJ", Request id "0HM867749Q1JJ:00000002": An unhandled exception was thrown by the application. 
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'. 
 ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'System.String'. 
 ---> System.Net.Http.HttpRequestException: Connection refused (identity.co-farming.com:443) 
 ---> System.Net.Sockets.SocketException (111): Connection refused 
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) 
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) 
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) 
   at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken) 
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken) 
   --- End of inner exception stack trace --- 
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken) 
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) 
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) 
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) 
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) 
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) 
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) 

If this error still persist, this is related with IdentityServer configuration which is, your api resource can not connect to IdentityServer.

Check api's Authorization configuration is appsettings match with your production authentication server's url. Most likely it is related with HTTPS.

Showing 721 to 730 of 867 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 08:30