protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            CouponHubDBEntities db = new CouponHubDBEntities();
            if (value == null)
            {
                return new ValidationResult("Email Address is required");
            }

            String UserEmailValue = value.ToString();
            int count = db.User_Table.Where(x => x.UserEmail == UserEmailValue).ToList().Count();
            if (count != 0)
            {
                return new ValidationResult("User Already Exists With This Email ID");
            }
            return ValidationResult.Success;
        }
Example #2
0
 public URLdb()
 {
     db = new CouponHubDBEntities();
 }
Example #3
0
 public UserDB()
 {
     db = new CouponHubDBEntities();
 }