public static IMvcBuilder AddSignInControllers(this IMvcBuilder mvcBuilder) { mvcBuilder.ConfigureApplicationPartManager(setup => { var types = new[] { typeof(SignInController).GetTypeInfo() }; var typesProvider = new TypesProvidingApplicationPart(types); setup.ApplicationParts.Add(typesProvider); }); return(mvcBuilder); }
public static BearerIdentityMvcBuilder <UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType> AddAccountControllers <UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(this IMvcBuilder mvcBuilder) where UserDescriptorType : IUserDescriptor where UserType : IUserEntity where RoleDescriptorType : IRoleDescriptor { mvcBuilder.ConfigureApplicationPartManager(setup => { var accountControllerTypeInfo = typeof(AccountController <UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>).GetTypeInfo(); var applicationTypes = new[] { accountControllerTypeInfo }; var constrainedTypesProvider = new TypesProvidingApplicationPart(applicationTypes); setup.ApplicationParts.Add(constrainedTypesProvider); }); return(new BearerIdentityMvcBuilder <UserDescriptorType, UserType, UserCreationType, RoleDescriptorType, RoleType, RoleCreationType>(mvcBuilder)); }