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

Activities of "rcasaca"

  • What is your product version? 11.0.0
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core

I'm trying to add some custom data filtering in CreateFilterExpression method.

                Expression<Func<BookingEntity, bool>> entityTypes = e =>
                    e.Type == AccountAssociationType.Shipper
                    && ((e.AccountId == 4958 && e.Booking.AccountId == 2) || (e.AccountId == 4969 && e.Booking.AccountId == 3));

I've already built the condition using PredicateBuilder.

                Expression<Func<BookingEntity, bool>> entityTypesPredicate = PredicateBuilder.New<BookingEntity>(true);
                entityTypesPredicate = entityTypesPredicate.And(w => w.Type == AccountAssociationType.Shipper);
                Expression<Func<BookingEntity, bool>> predicateAssociations = PredicateBuilder.New<BookingEntity>(true);
                foreach (var a in AvailableContactAssociations)
                    predicateAssociations = predicateAssociations.Or(w => w.AccountId == a.Key && w.Booking.AccountId == a.Value);
                entityTypesPredicate = entityTypesPredicate.And(predicateAssociations);

Since entityTypesPredicate is built only when the application starts, how can use it every time I want to use it while building the FilterExpression? AvailableContactAssociations looks like: protected virtual List<ContactAssociation> AvailableContactAssociations

Any tip? What am I missing?

Thanks!

  • What is your product version?
  • 10.0.4
  • What is your product type (Angular or MVC)?
  • MVC
  • What is product framework type (.net framework or .net core)?
  • .net core

I'm having an error while loading my app using AWS Beanstalk. The error: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\AspNetCoreWebApps\app\tempkey.jwk' is denied.

Any tip? Thanks.

  • What is your product version?
    • 10.0.3
  • What is your product type (Angular or MVC)?
    • MVC
  • What is product framework type (.net framework or .net core)?
    • .net core

Hi all, I'm trying to access TenantManager in BackgroundJob. But i'm getting is disposed error.

System.ObjectDisposedException Cannot access a disposed context instance. A common cause of this error is disposing a context instance 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 instance, or wrapping it 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: 'CustomerHubDbContext'.

System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance 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 instance, or wrapping it 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: 'CustomerHubDbContext'. at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed() at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies() at Microsoft.EntityFrameworkCore.DbContext.get_Model() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable() at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Collections.Generic.IEnumerable<TEntity>.GetEnumerator() at CustomerHub.Jobs.SyncBusinessPartners.Execute(Int32 x) in C:_GIT\SyncBusinessPartners.cs:line 42

Below the code of SyncBusinessPartners Job (highlighted the row in error - line42)

public class SyncBusinessPartners : BackgroundJob<int>, ITransientDependency
{
	private readonly TenantManager _tenantManager;
	private readonly IAbpSession _abpSession;
	private readonly UserManager _userManager;
	private readonly ILogger<SyncBusinessPartners> _logger;

	public SyncBusinessPartners(
		TenantManager tenantManager,
		IAbpSession abpSession,
		UserManager userManager,
		ILogger<SyncBusinessPartners> logger
	)
	{
		_tenantManager = tenantManager;
		_abpSession = abpSession;
		_userManager = userManager;
		_logger = logger;
		LocalizationSourceName = CustomerHubConsts.LocalizationSourceName;
	}

	public override void Execute(int x)
	{
		_logger.LogInformation(L("JobExecutionStarted", args: $"{nameof(SyncBusinessPartners)}"));

		**foreach (var t in _tenantManager.Tenants)**
		{
			var admin = _userManager.FindByNameAsync("admin").Result;
		}

		_logger.LogInformation(L("JobExecutionFinished", args: nameof(DocumentDto)));
	}
}

I've tried to use UnitOfWork attribute on my method Execute. But when i do this, all the information to be synced in bulk and not iteration by iteration.

Thanks in advance!

Question
  • What is your product version?
    • 10.0.0
  • What is your product type (Angular or MVC)?
    • MVC
  • What is product framework type (.net framework or .net core)?
    • .net core

How can i add a new SettingScope? I need some settings to be linked to User and their Companies or Working Sites. When retrieved they should fallback up to Company starting at User level.

Do i need to create a specific Setting entity? Also a new SettingManager?

Any tip? Thanks

  • What is your product version?
    • 10.0.0
  • What is your product type (Angular or MVC)?
    • MVC
  • What is product framework type (.net framework or .net core)?
    • .net core

Hi, I'm trying to built an "global filter", like a scope, to filter all my queries on entities that depends on it. Mix between Tenant and Localization.

I've already have the selection. It will store the value in Settings entity, using SettingManager.

My questions are:

  • What is the best approach to get the setting value and add it to my Session?
  • Also, and how can i apply it in all my queries?
    • I'll need inherit all my class Entities from Interface IMayHaveProject and/or IMustHaveProject that must be created?

Thanks in advance.

Showing 1 to 5 of 5 entries