using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models
{
    [SugarIndex("index_{table}_code", nameof(User.Code), OrderByType.Asc,  isUnique: true)]
    public class User:BaseTable
    { 
        [SugarColumn(Length =16)]
        public string Code { get; set; }
        public string Name { get; set; }
        [SugarColumn(IsNullable = true)]
        public string Password { get; set; }
        public int RoleId { get; set; }

        [Navigate(NavigateType.ManyToOne, nameof(RoleId))]
        public Role RoleInfo { get; set; }

        public bool State { get; set; } = true;

        [SugarColumn(IsNullable = true)]
        public string Note { get; set; }

    }
}
