Source

main-vinayFork / Source / WebClient / Web.Client / ViewModel / Registration.cs

Full commit
using System.ComponentModel.DataAnnotations;

namespace DataUp.Web.Client.ViewModel
{
    public class RegistrationViewModel
    {
        public int UserID { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Name Identifier is required.")]
        [Display(Name = "Name Identifier")]
        [DataType(DataType.Text)]
        public string NameIdentifier { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Identity Provider is required.")]
        [Display(Name = "Identity Provider")]
        [DataType(DataType.Text)]
        public string IdentityProvider { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "First Name is required.")]
        [Display(Name = "First Name")]
        [DataType(DataType.Text)]
        [RegularExpression(@"^[ a-zA-Z0-9_*@!,.-]*$", ErrorMessage = "Name should not contain special characters")]
        public string FirstName { get; set; }

        [Display(Name = "Middle Name")]
        [DataType(DataType.Text)]
        [RegularExpression(@"^[ a-zA-Z0-9_*@!,.-]*$", ErrorMessage = "Name should not contain special characters")]
        public string MiddleName { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Last Name is required.")]
        [Display(Name = "Last Name")]
        [DataType(DataType.Text)]
        [RegularExpression(@"^[ a-zA-Z0-9_*@!,.-]*$", ErrorMessage = "Name should not contain special characters")]
        public string LastName { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Organization is required.")]
        [Display(Name = "Organization")]
        [DataType(DataType.Text)]
        public string Organization { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Email Id is required.")]
        [Display(Name = "Email")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?", ErrorMessage = "Please re-enter a valid email address")]
        public string EmailId { get; set; }

        public string UrlReferrer { get; set; }
    }
}