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;
 }
Esempio n. 2
0
 public HomeController(NavasthalaContext context)
 {
     _context = context;
 }
Esempio n. 3
0
 public AdminController(NavasthalaContext context)
 {
     _context = context;
 }
Esempio n. 4
0
 public UserController(NavasthalaContext context)
 {
     _context = context;
 }
 public AccountController(NavasthalaContext context)
 {
     _context = context;
 }
 public InvestorController(NavasthalaContext context)
 {
     _context = context;
 }