Add empty crypto and fix user validator compilation

This commit is contained in:
Hao Kung 2014-03-04 13:02:56 -08:00
parent b13d26cab6
commit bc756706aa
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#if K10
using System;
using System.Runtime.CompilerServices;
//using System.Security.Cryptography;
namespace Microsoft.AspNet.Identity
{
public class Foo
{
public Foo()
{
System.Security.Cryptography.Rfc2898DeriveBytes foo = null;
}
}
}
#endif

View File

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
#if NET45
using System.Net.Mail;
#endif
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@ -96,6 +98,7 @@ namespace Microsoft.AspNet.Identity
errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.PropertyTooShort, "Email"));
return;
}
#if NET45
try
{
var m = new MailAddress(email);
@ -105,6 +108,7 @@ namespace Microsoft.AspNet.Identity
errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.InvalidEmail, email));
return;
}
#endif
var owner = await Manager.FindByEmail(email);
if (owner != null && !EqualityComparer<TKey>.Default.Equals(owner.Id, user.Id))
{