-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: apply code style to recent changes
- Loading branch information
Showing
21 changed files
with
1,108 additions
and
1,132 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
<packageSources> | ||
<clear /> | ||
<add key="NuGet" value="https://nuget.org/api/v2/" /> | ||
</packageSources> | ||
</configuration> | ||
<packageSources> | ||
<clear /> | ||
<add key="NuGet" value="https://nuget.org/api/v2/" /> | ||
</packageSources> | ||
</configuration> |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0"?> | ||
|
||
<configuration> | ||
<system.webServer> | ||
<handlers> | ||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> | ||
</handlers> | ||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" | ||
stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" /> | ||
</system.webServer> | ||
<system.webServer> | ||
<handlers> | ||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> | ||
</handlers> | ||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" | ||
stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" /> | ||
</system.webServer> | ||
</configuration> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,64 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
using System; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace AspNetCore.Identity.DynamoDB | ||
{ | ||
public class DynamoDBIdentityBuilder<TUser,TRole> | ||
where TUser: DynamoIdentityUser | ||
where TRole: DynamoIdentityRole | ||
{ | ||
public IServiceCollection Services { get; set; } | ||
public Type UserType { get; set; } | ||
public Type RoleType { get; set; } | ||
public class DynamoDBIdentityBuilder<TUser, TRole> | ||
where TUser : DynamoIdentityUser | ||
where TRole : DynamoIdentityRole | ||
{ | ||
public DynamoDBIdentityBuilder(IServiceCollection services) | ||
{ | ||
Services = services; | ||
UserType = typeof(TUser); | ||
RoleType = typeof(TRole); | ||
} | ||
|
||
public DynamoDBIdentityBuilder(IServiceCollection services) | ||
{ | ||
Services = services; | ||
UserType = typeof(TUser); | ||
RoleType = typeof(TRole); | ||
} | ||
public IServiceCollection Services { get; set; } | ||
public Type UserType { get; set; } | ||
public Type RoleType { get; set; } | ||
|
||
private DynamoDBIdentityBuilder<TUser,TRole> AddScoped(Type serviceType, Type concreteType) | ||
{ | ||
Services.AddScoped(serviceType, concreteType); | ||
return this; | ||
} | ||
private DynamoDBIdentityBuilder<TUser, TRole> AddScoped(Type serviceType, Type concreteType) | ||
{ | ||
Services.AddScoped(serviceType, concreteType); | ||
return this; | ||
} | ||
|
||
private DynamoDBIdentityBuilder<TUser,TRole> AddSingleton(Type serviceType, Type concreteType) | ||
{ | ||
Services.AddSingleton(serviceType, concreteType); | ||
return this; | ||
} | ||
private DynamoDBIdentityBuilder<TUser, TRole> AddSingleton(Type serviceType, Type concreteType) | ||
{ | ||
Services.AddSingleton(serviceType, concreteType); | ||
return this; | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser,TRole> AddUserStore<T>() where T: class | ||
{ | ||
return AddSingleton(typeof(IUserStore<>).MakeGenericType(UserType), typeof(T)); | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddUserStore<T>() where T : class | ||
{ | ||
return AddSingleton(typeof(IUserStore<>).MakeGenericType(UserType), typeof(T)); | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser, TRole> AddUserStore() | ||
{ | ||
return AddUserStore<DynamoUserStore<TUser, TRole>>(); | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddUserStore() | ||
{ | ||
return AddUserStore<DynamoUserStore<TUser, TRole>>(); | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleStore<T>() where T : class | ||
{ | ||
return AddSingleton(typeof(IRoleClaimStore<>).MakeGenericType(RoleType), typeof(T)); | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleStore<T>() where T : class | ||
{ | ||
return AddSingleton(typeof(IRoleClaimStore<>).MakeGenericType(RoleType), typeof(T)); | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleStore() | ||
{ | ||
return AddRoleStore<DynamoRoleStore<TRole>>(); | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleStore() | ||
{ | ||
return AddRoleStore<DynamoRoleStore<TRole>>(); | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleUsersStore<T>() where T : class | ||
{ | ||
return AddSingleton(typeof(T), typeof(T)); | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleUsersStore<T>() where T : class | ||
{ | ||
return AddSingleton(typeof(T), typeof(T)); | ||
} | ||
|
||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleUsersStore() | ||
{ | ||
return AddRoleUsersStore<DynamoRoleUsersStore<TRole, TUser>>(); | ||
} | ||
} | ||
} | ||
public DynamoDBIdentityBuilder<TUser, TRole> AddRoleUsersStore() | ||
{ | ||
return AddRoleUsersStore<DynamoRoleUsersStore<TRole, TUser>>(); | ||
} | ||
} | ||
} |
26 changes: 11 additions & 15 deletions
26
src/AspNetCore.Identity.DynamoDB/DynamoDBServiceCollectionExtensions.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace AspNetCore.Identity.DynamoDB | ||
{ | ||
public static class DynamoDBServiceCollectionExtensions | ||
{ | ||
public static DynamoDBIdentityBuilder<TUser,TRole> AddDynamoDBIdentity<TUser, TRole>(this IServiceCollection services) | ||
where TUser: DynamoIdentityUser | ||
where TRole: DynamoIdentityRole | ||
{ | ||
return new DynamoDBIdentityBuilder<TUser,TRole>(services); | ||
} | ||
} | ||
} | ||
public static class DynamoDBServiceCollectionExtensions | ||
{ | ||
public static DynamoDBIdentityBuilder<TUser, TRole> AddDynamoDBIdentity<TUser, TRole>(this IServiceCollection services) | ||
where TUser : DynamoIdentityUser | ||
where TRole : DynamoIdentityRole | ||
{ | ||
return new DynamoDBIdentityBuilder<TUser, TRole>(services); | ||
} | ||
} | ||
} |
Oops, something went wrong.