Skip to content

Instantly share code, notes, and snippets.

View iyhammad's full-sized avatar

Ibrahim Hammad iyhammad

  • Berlin, Germany
View GitHub Profile
@ismcagdas
ismcagdas / MyAppSession.cs
Last active April 27, 2021 13:18
How to add custom field to AbpSession in ASP.NET Core
//Define your own session and add your custom field to it
//Then, you can inject MyAppSession and use it's new property in your project.
public class MyAppSession : ClaimsAbpSession, ITransientDependency
{
public MyAppSession(
IPrincipalAccessor principalAccessor,
IMultiTenancyConfig multiTenancy,
ITenantResolver tenantResolver,
IAmbientScopeProvider<SessionOverride> sessionOverrideScopeProvider) :
base(principalAccessor, multiTenancy, tenantResolver, sessionOverrideScopeProvider)
@IanYates
IanYates / HangFireWindsor.cs
Created January 20, 2016 23:30
Proper integration between Hangfire and Windsor - does not take advantage of new HangFire 1.5 IoC features
To configure Hangfire
//Windsor integration
//The activator
var jobActivator = new WindsorScopedJobActivator(windsorContainer);
GlobalConfiguration.Configuration.UseActivator(jobActivator);
//And something to create and dispose of a child container in the activator for each job
var windsorJobFilter = new WindsorContainerPerJobFilterAttribute(jobActivator);
GlobalJobFilters.Filters.Add(windsorJobFilter);