Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Threading.Tasks;
using ConsoleSample;
using Hangfire;
using Hangfire.Logging;
using Hangfire.Pro.Redis;
using Microsoft.Owin;
using Microsoft.Owin.Hosting;
using Owin;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using Hangfire.Dashboard.Owin;
namespace WebApplication34
{
public class MvcAntiforgery : IOwinDashboardAntiforgery
using System;
using System.Threading.Tasks;
using Hangfire;
using Hangfire.Common;
using Hangfire.States;
using Hangfire.Storage;
using Microsoft.Owin.Hosting;
using Owin;
namespace ConsoleApp71
using System;
using System.Linq;
using Hangfire;
using Hangfire.Batches.Client;
using Hangfire.Client;
using Hangfire.Storage;
using Moq;
using Xunit;
namespace ClassLibrary1
using System;
using System.Linq;
using Hangfire;
using Hangfire.Batches.Client;
using Hangfire.Client;
using Hangfire.Storage;
using Moq;
using Xunit;
namespace ClassLibrary1
public class MyAutofacActivator : JobActivator
{
private readonly ILifetimeScope _lifetimeScope;
public MyAutofacActivator(ILifetimeScope lifetimeScope)
{
_lifetimeScope = lifetimeScope;
}
public override JobActivatorScope BeginScope(JobActivatorContext context)
// This file is part of Hangfire.
// Copyright © 2017 Sergey Odinokov.
//
// Hangfire is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3
// of the License, or any later version.
//
// Hangfire is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
using System;
using System.Web.Mvc;
using Hangfire;
namespace MyApplication
{
public class HomeController : Controller
{
private readonly IBackgroundJobClient _backgroundJobs;
using System;
using System.Linq.Expressions;
using Hangfire.Annotations;
using Hangfire.Common;
using Hangfire.States;
namespace Hangfire
{
public static class RecurringJobManagerExtensions
{
@odinserj
odinserj / App.cs
Last active October 24, 2019 08:56
GlobalConfiguration.Configuration
.UseFilter(new OverrideJobIdFilter());
OverrideJobIdFilter.SetOverriddenId(Guid.Parse("266AC580-4FF9-4E72-B06A-CA20D7664B9E"));
BackgroundJob.Enqueue(() => Empty());