Is it possible to have a different theme settings though if using the same application ?.
Hello - This is for Angular Application with .NET Core
This is not when Entity is not there for a primary key ( say Id for value 2.)
If the entity has varchar column that is NULLABLE and if NULL value exists in that column, It throws the following error.
"Operation Not allowed on NULL Values"
but the Entity record is present for the given primary key.
It looks like Abp is not checking NULL values before converting/casting to a String.
The group of users ( of certain role) all need to see same pages/menu options etc..I wanted to make clear.
Hi- The requirement is certain class of users ( say specific role "End User" ) need to have their own themesettings, navigation. menu and access to pages. (More like for an end user) rather than for a Tenant Admin ( say for e.g) as Tenant admin has more access to functionality. it is not per user , but for a group of users ( having same role). Again they dont need the ability to control any of these. It is just we want to deploy specific themesetting , navigation etc for certain role compared to any other tenant user/admin.
Is it possible to acheive this without duplicating the front end (Angular part) as themesettings are loaded based on the tenant and the end users will belong to the same tenant. Is it possible to segregate UI customization & navigation based on the user role ?
Regards, Sesha K.
Thankyou. That solved the problem.
the error happens on the below line in method "CheckSchedule". List<CalculatorSchedule> lstSchedule = this._schedule.GetAll().ToList();
public class CalculatorScheduler : BackgroundService
{
private readonly ILogger<CalculatorScheduler> _logger;
private readonly ICalculatorProfileJob _job;
private readonly IRepository<CalculatorSchedule, int> _schedule;
private Timer _timer;
public CalculatorScheduler(ILogger<CalculatorScheduler> logger,
ICalculatorProfileJob job,
IRepository<CalculatorSchedule, int> schedule
)
{
_logger = logger;
_job = job;
_schedule = schedule;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
await Task.Delay(1000, stoppingToken);
}
}
public override Task StartAsync(CancellationToken cancellationToken)
{
_timer = new Timer(CheckSchedule, null, 0, Convert.ToInt32(TimeSpan.FromSeconds(30).TotalMilliseconds));
return Task.CompletedTask;
}
public override Task StopAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("Worker stopping at: {time}", DateTimeOffset.Now);
_timer?.Change(Timeout.Infinite, 0);
return Task.CompletedTask;
}
private void CheckSchedule(object state)
{
List<CalculatorSchedule> lstSchedule = this._schedule.GetAll().ToList();
foreach (CalculatorSchedule sched in lstSchedule)
_job.ExecuteJob(sched);
}
}
Hi- The following code solved the DI Problem. Can you please check but I am getting a different error explained below. I will also post the code that causes the problem
public static IHostBuilder CreateHostBuilder(string[] args)
{
var abpBootstrapper = AbpBootstrapper.Create<CalculatorSchedulerModule>();
abpBootstrapper.Initialize();
return Host.CreateDefaultBuilder(args)
.UseWindowsService()
.UseCastleWindsor(abpBootstrapper.IocManager.IocContainer)
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<CalculatorScheduler>();
});
}
** Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'FPEDbContext'.**
System.AggregateException
HResult=0x80131500
Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: CalculatorSchedulerService.CalculatorScheduler': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository2[SEB.FPE.Calculators.CalculatorProfile,System.Int32]' while attempting to activate 'SEB.FPE.Calculators.Jobs.CalculatorProfileJob'.) (Error while validating the service descriptor 'ServiceType: SEB.FPE.Calculators.Jobs.ICalculatorProfileJob Lifetime: Singleton ImplementationType: SEB.FPE.Calculators.Jobs.CalculatorProfileJob': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository
2[SEB.FPE.Calculators.CalculatorProfile,System.Int32]' while attempting to activate 'SEB.FPE.Calculators.Jobs.CalculatorProfileJob'.)
Source=Microsoft.Extensions.DependencyInjection
StackTrace:
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, ServiceProviderOptions options) at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options) at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder) at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter
1.CreateServiceProvider(Object containerBuilder)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at CalculatorSchedulerService.Program.Main(String[] args) in C:\Users\sesha.krishnamurthy\Source\repos\FPE\FPE\aspnet-core\src\CalculatorSchedulerService\Program.cs:line 41
This exception was originally thrown at this call stack: [External Code]
Inner Exception 1: InvalidOperationException: Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: CalculatorSchedulerService.CalculatorScheduler': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository`2[SEB.FPE.Calculators.CalculatorProfile,System.Int32]' while attempting to activate 'SEB.FPE.Calculators.Jobs.CalculatorProfileJob'.
Inner Exception 2: InvalidOperationException: Unable to resolve service for type 'Abp.Domain.Repositories.IRepository`2[SEB.FPE.Calculators.CalculatorProfile,System.Int32]' while attempting to activate 'SEB.FPE.Calculators.Jobs.CalculatorProfileJob'.