This file contains 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
//Create a base class for common parameters | |
public class KendoInputDto : IInputDto | |
{ | |
public int Take { get; set; } | |
public int Skip { get; set; } | |
public IEnumerable<Sort> Sort { get; set; } | |
public Filter Filter { get; set; } | |
} |
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var container = new WindsorContainer()) | |
{ | |
container.Register( | |
Component.For<MyInterceptor>().LifestyleTransient(), | |
Component.For<MyTester>().Interceptors<MyInterceptor>().LifestyleTransient() | |
); |
This file contains 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
[DependsOn(typeof(AbpEntityFrameworkModule))] | |
public class MyModule : AbpModule | |
{ | |
public override void Initialize() | |
{ | |
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); | |
} | |
} |
This file contains 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
System.NullReferenceExceptionObject reference not set to an instance of an object. | |
at Effort.Internal.CommandActions.DbCommandActionHelper.FormatParameters(IList`1 source, IList`1 description, ITypeConverter converter) | |
at Effort.Internal.CommandActions.QueryCommandAction.ExecuteDataReader(ActionContext context) | |
at Effort.Provider.EffortEntityCommand.ExecuteDbDataReader(CommandBehavior behavior) | |
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) | |
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c) | |
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) | |
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) | |
at System.Data.Entity.Internal.InterceptableDbCommand.Execu |
This file contains 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 partial class Create_Indexes_For_Module_Zero_Tables : DbMigration | |
{ | |
public override void Up() | |
{ | |
DropIndex("AbpPermissions", new[] { "UserId" }); | |
DropIndex("AbpPermissions", new[] { "RoleId" }); | |
DropIndex("AbpRoles", new[] { "TenantId" }); | |
DropIndex("AbpSettings", new[] { "TenantId" }); | |
DropIndex("AbpSettings", new[] { "UserId" }); | |
DropIndex("AbpUserLogins", new[] { "UserId" }); |
This file contains 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 class GetScenariosInput : IPagedResultRequest, ISortedResultRequest, IShouldNormalize | |
{ | |
public int MaxResultCount { get; set; } | |
public int SkipCount { get; set; } | |
public string Sorting { get; set; } | |
public bool? IsActive { get; set; } | |
public GetScenariosInput() | |
{ |
This file contains 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; |
This file contains 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 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 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 |
OlderNewer