This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Abp.Dependency; | |
using Castle.Core.Logging; | |
namespace Halil.HangfireTests.Web.Controllers | |
{ | |
public class MyJob1Class : ITransientDependency | |
{ | |
private readonly ILogger _logger; | |
public MyJob1Class(ILogger logger) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Abp.Runtime.Session; | |
namespace Abp.Temp | |
{ | |
public static class AbpSessionExtensions | |
{ | |
public static IDisposable Override(this IAbpSession abpSession, int? tenantId, long? userId) | |
{ | |
var overridableSession = abpSession as OverridableSession; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
namespace AbpWebSite.Templates | |
{ | |
/// <summary> | |
/// Used to rename a solution | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Abp.Collections.Extensions; | |
using Abp.Dependency; | |
using Abp.Domain.Uow; | |
using Abp.EntityFramework.Repositories; | |
using Abp.MultiTenancy; | |
namespace Abp.EntityFramework |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Entity; | |
using Abp.Application.Editions; | |
using Abp.Application.Features; | |
using Abp.Auditing; | |
using Abp.Authorization; | |
using Abp.Authorization.Roles; | |
using Abp.Authorization.Users; | |
using Abp.BackgroundJobs; | |
using Abp.Configuration; | |
using Abp.Localization; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface INotificationManager | |
{ | |
/// <summary> | |
/// Subscribes a user to a notificationName for any event. | |
/// </summary> | |
void Subscribe(long userId, string notificationName); | |
/// <summary> | |
/// Subscribes a user to a notificationName for events on specific Entity type. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add new property to claims on login | |
private async Task SignInAsync(User user, ClaimsIdentity identity = null, bool rememberMe = false) | |
{ | |
if (identity == null) | |
{ | |
identity = await _userManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); | |
} | |
identity.AddClaim(new Claim("Application_UserEmail", user.EmailAddress)); //SETTING NEW PROPERTY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Remove this: | |
AbpBootstrapper.IocManager.IocContainer | |
.AddFacility<LoggingFacility>(f => f.UseLog4Net() | |
.WithConfig("log4net.config") | |
); | |
//Add this: | |
AbpBootstrapper.IocManager.IocContainer.Register( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SAMPLE AJAX CALL to this action: | |
(This is enough since it's automatically redirected to the target tenant's ImpersonateSignIn action) | |
abp.ajax({ | |
url: abp.appPath + 'Account/Impersonate', | |
data: JSON.stringify({ | |
tenantId: 1, //Target tenant id (can be null if target user is a host user) | |
userId: 2 //Target user id | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Abp; | |
using Abp.Application.Services.Dto; | |
using Abp.Dependency; | |
using Abp.Domain.Entities.Auditing; | |
using Abp.Extensions; |