Fix build by adding System.Runtime 45 dependencies

This commit is contained in:
Hao Kung 2014-03-06 10:13:29 -08:00
parent 1553c674a4
commit 1ad07a38d7
4 changed files with 26 additions and 20 deletions

View File

@ -256,18 +256,17 @@ namespace Microsoft.AspNet.Identity.InMemory
return Task.FromResult(0);
}
private class LoginComparer : IEqualityComparer<UserLoginInfo>
private class LoginComparer : IEqualityComparer<UserLoginInfo>
{
public bool Equals(UserLoginInfo x, UserLoginInfo y)
{
public bool Equals(UserLoginInfo x, UserLoginInfo y)
{
return x.LoginProvider == y.LoginProvider && x.ProviderKey == y.ProviderKey;
}
public int GetHashCode(UserLoginInfo obj)
{
return (obj.ProviderKey + "--" + obj.LoginProvider).GetHashCode();
}
return x.LoginProvider == y.LoginProvider && x.ProviderKey == y.ProviderKey;
}
public int GetHashCode(UserLoginInfo obj)
{
return (obj.ProviderKey + "--" + obj.LoginProvider).GetHashCode();
}
}
}
}

View File

@ -1,11 +1,17 @@
{
"version" : "0.1-alpha-*",
"dependencies": {
"System.Collections.Immutable" : "1.1.15.0",
"Microsoft.AspNet.Identity" : "0.1-alpha-*",
"System.Security.Claims" : "0.1-alpha-*"
},
"configurations": {
"net45": {},
"net45": {
"dependencies": {
"System.Runtime" : "",
"System.Collections" : ""
}
},
"k10": {}
}
}

View File

@ -56,23 +56,19 @@ namespace Microsoft.AspNet.Identity
{
errors.Add(Resources.PasswordRequireNonLetterOrDigit);
}
if (RequireDigit && item.All(c => !IsDigit(c)))
if (RequireDigit && !item.Any(IsDigit))
{
errors.Add(Resources.PasswordRequireDigit);
}
if (RequireLowercase && item.All(c => !IsLower(c)))
if (RequireLowercase && !item.Any(IsLower))
{
errors.Add(Resources.PasswordRequireLower);
}
if (RequireUppercase && item.All(c => !IsUpper(c)))
if (RequireUppercase && !item.Any(IsUpper))
{
errors.Add(Resources.PasswordRequireUpper);
}
if (errors.Count == 0)
{
return Task.FromResult(IdentityResult.Success);
}
return Task.FromResult(IdentityResult.Failed(String.Join(" ", errors)));
return Task.FromResult(errors.Count == 0 ? IdentityResult.Success : IdentityResult.Failed(String.Join(" ", errors)));
}
/// <summary>

View File

@ -5,7 +5,12 @@
"System.Security.Claims" : "0.1-alpha-*"
},
"configurations": {
"net45": {},
"net45": {
"dependencies": {
"System.Runtime" : "",
"System.Collections" : ""
}
},
"k10": {}
}
}