Starts in:
1 DAY
22 HRS
5 MIN
18 SEC
Starts in:
1 D
22 H
5 M
18 S

Activities of "alkaabi"

Answer

Hi,

I am activating through someting called ObjectDataSourceProvider. I dont really know about the implemenation details of that class and how the service get registered. That class comes part of Devexpress Reporting suite. To get an idea od how this is done, I will share their example of how they are doing it with standard ASP .Net Core App and EF Core:

https://github.com/DevExpress-Examples/Reporting-Entity-Framework-Core-In-AspNet-Core

I would appreciate if you could guide me how to inetgrate this with Abp using Abp infrastructure.

Thanks

Answer

I have created another another db context provider which inherits from Abp db context provider :

 public interface IScopedDbContextProvider<TDbContext> : 
        IDbContextProvider<TDbContext> where TDbContext: IEfCoreDbContext
 {
 }

    public class ScopedDbContextProvider<TDbContext> : 
        UnitOfWorkDbContextProvider<TDbContext>, IScopedDbContextProvider<TDbContext> where TDbContext : IEfCoreDbContext
  {
        public ScopedDbContextProvider(IUnitOfWorkManager unitOfWorkManager,
            IConnectionStringResolver connectionStringResolver,
            ICancellationTokenProvider cancellationTokenProvider,
            ICurrentTenant currentTenant,
            IOptions<AbpDbContextOptions> options) :base(
                unitOfWorkManager,
                connectionStringResolver,
                cancellationTokenProvider,
                currentTenant,
                options)
  {

  }

Then I registered the provider as a siglton

context.Services.TryAddSingleton(typeof(IScopedDbContextProvider<>), typeof(ScopedDbContextProvider<>));

Then I created custom repository and I used that new IScopedDbContextProvider in the repository

 public class RepPersonRepository : EfCoreRepository<JundDbContext, Person, Guid>, IRepPersonRepository
    {
        public RepPersonRepository(IScopedDbContextProvider<JundDbContext> dbContextProvider) : base(dbContextProvider)
        {

        }
    }

Then I used the repository inside a regular Abp Application Service

 public class ReportingDataSourceService: ApplicationService, IReportingDataSourceService
    {
        private readonly IRepPersonRepository _personRepository;
        public ReportingDataSourceService()
        {
            // We use this parameterless constructor in the Data Source Wizard only, and not for the actual instantiation of the repository object.
            throw new NotSupportedException();
        }
        public ReportingDataSourceService(IRepPersonRepository perosnRepository)
        {
            _personRepository = perosnRepository;
        }

        public  IList<PersonDetailsDto> GetAllPeople()
        {

            return ObjectMapper.Map<IList<Person>, IList<PersonDetailsDto>>(
                _personRepository.WithDetailsAsync(
                    p => p.Rank,
                    p => p.ServiceNumberPrefix,
                    p => p.BirthLocation,
                    p => p.ContactAddresses
                ).Result.ToList());

        }
}

Whenever I call the endpoint using swagger UI, everything works fine and I get the result but when I set the service as datasource for the report I get this error:

All Objects have been disposed from repository as shown below

yes, I did..

It was a silly mistake. In Host project App Setting file, there is an entry for AuthServer which had the wrong IP address (localhost). I entered the correct ip address and everything worked fine.

Hi @GregB

Check baseUrl in envronemnt.prod.ts in Angular Client

Hi @gvnuysal,

Thanks for your response. I did what you did without luck. In fact, I prevoisly modified IdentityServerClientRedirectUris table to include the angular client url but did not work. I have also modified ClientUri just like you said without luck. I have wasted too many hours trying to figure out what is wrong.

Hi,

I hosted the following on a sepearte IIS website (diffrent machines)

1- Api.Host project using publish menu in VS (running under https) 2- IdentityServer project using publish menu in VS (running under https) 3- angular client (runnning under http)

I have also changed Cors Oirgin urls in app settings to match Angular Client IIS addresses

Hi,

Our production server are not connected to the internet. However, I made a smilar environemnt and hosted the apps on IIS and I still get the same problem.

How can you you help remotely ?? Via which app ?? Remote Desktop ?

Here is a screenshot of identity logs. NO error is shown

Here is a screenshot of the login process. There is no any log error in Identity server or angular application. You urgent help is much appreciated

<br>

<br> <br>

Hi,

Unfortunately, We are not using Razor UI for our project. We are using angular. I dont think it will be an easy task to replace organization unit component using the Replaceable Component Api. Is it?

Showing 1 to 10 of 13 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06