Пример #1
0
        /// <summary>
        /// Public constructor with required data
        /// </summary>
        /// <param name="email">Email of the admin</param>
        /// <param name="passwordhash">Password of the admin</param>
        /// <param name="status">Status of the account</param>
        /// <param name="signalrid">The SignalR id for the current session of this admin</param>
        public Admin(string email, string passwordhash, global::BackendModel.AdminAccountStatus status, string signalrid)
        {
            if (string.IsNullOrEmpty(email))
            {
                throw new ArgumentNullException(nameof(email));
            }
            this.Email = email;

            if (string.IsNullOrEmpty(passwordhash))
            {
                throw new ArgumentNullException(nameof(passwordhash));
            }
            this.PasswordHash = passwordhash;

            this.Status = status;

            if (string.IsNullOrEmpty(signalrid))
            {
                throw new ArgumentNullException(nameof(signalrid));
            }
            this.SignalRId = signalrid;

            Init();
        }
Пример #2
0
 /// <summary>
 /// Static create function (for use in LINQ queries, etc.)
 /// </summary>
 /// <param name="email">Email of the admin</param>
 /// <param name="passwordhash">Password of the admin</param>
 /// <param name="status">Status of the account</param>
 /// <param name="signalrid">The SignalR id for the current session of this admin</param>
 public static Admin Create(string email, string passwordhash, global::BackendModel.AdminAccountStatus status, string signalrid)
 {
     return(new Admin(email, passwordhash, status, signalrid));
 }