using CloudBuilder.Core.Authorization;
namespace CloudBuilder.Security
{
    [TypeScript]
    public class SecurityUserDelegatedPermissionEntityKey
    {
        public string UserName  { get; set; }
        public string DelegatedByUser  { get; set; }
        public string PermissionName  { get; set; }

        public override bool Equals(object obj)
        {
            if (this == obj) return true;

            SecurityUserDelegatedPermissionEntityKey pkey = obj as SecurityUserDelegatedPermissionEntityKey;
            if (pkey == null) return false;

            if (UserName != pkey.UserName) return false;
            if (DelegatedByUser != pkey.DelegatedByUser) return false;
            if (PermissionName != pkey.PermissionName) return false;

            return true;
        }


            public override string ToString()
            {
                string declareSql="";
                declareSql=declareSql+$"declare @__tkey_UserName_0 varchar(50) select @__tkey_UserName_0 ='{UserName}'; " ;                declareSql=declareSql+$"declare @__tkey_DelegatedByUser_1 varchar(50) select @__tkey_DelegatedByUser_1 ='{DelegatedByUser}'; " ;                declareSql=declareSql+$"declare @__tkey_PermissionName_2 varchar(50) select @__tkey_PermissionName_2 ='{PermissionName}'; " ;
                return declareSql;
            }
        }
    }
    /* builder.Entity<SecurityUserDelegatedPermissionEntity>().HasKey(c => new {        c.UserName,        c.DelegatedByUser,        c.PermissionName});    */
