diff --git a/Settings.StyleCop b/Settings.StyleCop new file mode 100644 index 0000000000..91961eebc6 --- /dev/null +++ b/Settings.StyleCop @@ -0,0 +1,421 @@ + + + NoMerge + + + + + False + + + + + + + + + False + + + + + False + + + + + + as + db + dc + do + ef + id + if + in + is + my + no + on + sl + to + ui + vs + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + True + True + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + False + + + + + False + + + + + + + + + + False + + + + + False + + + + + False + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Identity.Authentication/IdentityBuilderExtensions.cs b/src/Microsoft.AspNet.Identity.Authentication/IdentityBuilderExtensions.cs index 7edcbdcbd2..b4e81a0593 100644 --- a/src/Microsoft.AspNet.Identity.Authentication/IdentityBuilderExtensions.cs +++ b/src/Microsoft.AspNet.Identity.Authentication/IdentityBuilderExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.Identity.Authentication; using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Identity.Authentication; namespace Microsoft.Framework.DependencyInjection { diff --git a/src/Microsoft.AspNet.Identity.EntityFramework/RoleStore.cs b/src/Microsoft.AspNet.Identity.EntityFramework/RoleStore.cs index 2a0b21303b..cf24e4e785 100644 --- a/src/Microsoft.AspNet.Identity.EntityFramework/RoleStore.cs +++ b/src/Microsoft.AspNet.Identity.EntityFramework/RoleStore.cs @@ -188,8 +188,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework { throw new ArgumentNullException("role"); } - IList result = RoleClaims.Where(rc => rc.RoleId == role.Id).Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); - return Task.FromResult(result); + var result = RoleClaims.Where(rc => rc.RoleId == role.Id).Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); + return Task.FromResult((IList)result); } public Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)) @@ -230,7 +230,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework { get { return Context.Set(); } } - private DbSet RoleClaims { get { return Context.Set(); } } + private DbSet RoleClaims { get { return Context.Set(); } } } } diff --git a/src/Microsoft.AspNet.Identity.EntityFramework/User.cs b/src/Microsoft.AspNet.Identity.EntityFramework/User.cs index b653ed9da9..a32252b738 100644 --- a/src/Microsoft.AspNet.Identity.EntityFramework/User.cs +++ b/src/Microsoft.AspNet.Identity.EntityFramework/User.cs @@ -88,7 +88,5 @@ namespace Microsoft.AspNet.Identity.EntityFramework /// Associated logins for the user /// public virtual ICollection Logins { get; private set; } - } -} - +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs b/src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs index cc50f1dc42..3f62c9cd72 100644 --- a/src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs +++ b/src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs @@ -367,8 +367,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework { throw new ArgumentNullException("user"); } - IList result = UserClaims.Where(uc => uc.UserId == user.Id).Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); - return Task.FromResult(result); + var result = UserClaims.Where(uc => uc.UserId == user.Id).Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList(); + return Task.FromResult((IList)result); } public Task AddClaimAsync(TUser user, Claim claim, CancellationToken cancellationToken = new CancellationToken()) @@ -405,7 +405,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework return Task.FromResult(0); } - public async virtual Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); @@ -426,6 +426,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework // TODO: fixup so we don't have to update both UserLogins.Add(l); user.Logins.Add(l); + return Task.FromResult(0); } public virtual Task RemoveLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) @@ -462,9 +463,8 @@ namespace Microsoft.AspNet.Identity.EntityFramework throw new ArgumentNullException("user"); } // todo: ensure logins loaded - IList result = - user.Logins.Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey)).ToList(); - return Task.FromResult(result); + var result = user.Logins.Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey)).ToList(); + return Task.FromResult((IList)result); } public async virtual Task FindByLoginAsync(UserLoginInfo login, CancellationToken cancellationToken = default(CancellationToken)) @@ -849,4 +849,4 @@ namespace Microsoft.AspNet.Identity.EntityFramework return Task.FromResult(user.TwoFactorEnabled); } } -} +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs index cd5571c1be..082d91f270 100644 --- a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs +++ b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs @@ -4,12 +4,10 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Security; -using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Test; using Microsoft.AspNet.Security.Cookies; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection.Fallback; -using Microsoft.Framework.OptionsModel; using Moq; using System.Security.Claims; using System.Threading.Tasks;