public override bool IsValid(object value)
 {
     var email = value as string;
     if (!string.IsNullOrEmpty(email))
     {
         var context = new NavasthalaContext();
         if (ClaimsPrincipal.Current.Identity.IsAuthenticated)
         {
             var userName = ClaimsPrincipal.Current.Identity.Name;
             return !context.UserProfiles.Where(p => !p.UserName.ToLower().Equals(userName.ToLower())).Any(p => p.Email.ToLower().Equals(email.ToLower()));
         }
         return !context.UserProfiles.Any(p => p.Email.ToLower().Equals(email.ToLower()));
     }
     return true;
 }
Exemplo n.º 2
0
 public HomeController(NavasthalaContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public AdminController(NavasthalaContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public UserController(NavasthalaContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public AccountController(NavasthalaContext context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public InvestorController(NavasthalaContext context)
 {
     _context = context;
 }