using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;


namespace Models
{

    public class User
    {


        #region Configuration
        public class Configuration : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<User>
        {
            public Configuration()
            {
                // username
                Property(current => current.Username)
                .IsUnicode(false)
                .HasMaxLength(50)
                .IsVariableLength()
                ;

                //password
                Property(current => current.Password)
                .IsUnicode(true)
                .HasMaxLength(40)
                .IsFixedLength()
                ;
            }
        }
        #endregion /Configuration


        public User()
        {
            Id = Guid.NewGuid();
        }


        public User
        (string firstName, string lastName, string username, string password,
            int isactive, string email, string avatar, string role)
        {
            FirstName = firstName;
            LastName = lastName;
            Username = username;
            Password = password;
            isActive = isactive;
            Email = email;
            Avatar = avatar;
            Role = role;
        }



        [Required]
        [Key()]
        public System.Guid Id { get; set; }

        [Required]
        public string FirstName { get; set; }

        [Required]
        public string LastName { get; set; }

        [Required]
        public string Username { get; set; }

        [Required]
        public string Password { get; set; }

        [Required]
        public int isActive { get; set; }

        [Required]
        public string Email { get; set; }

        [Required]
        public string Avatar { get; set; }

        public string Role { get; set; }


    }
}