コード例 #1
0
        public static SocialUser Create(string id, string displayName, EmailString email)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (displayName == null)
            {
                throw new ArgumentNullException(nameof(displayName));
            }
            if (email == null)
            {
                throw new ArgumentNullException(nameof(email));
            }

            return(new SocialUser
            {
                Id = id,
                DisplayName = displayName,
                Email = email
            });
        }
コード例 #2
0
ファイル: LocalUser.cs プロジェクト: DeafLight/SilentLux
        public static LocalUser Create(string id, string passwordHash, string displayName, EmailString email)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (passwordHash == null)
            {
                throw new ArgumentNullException(passwordHash);
            }
            if (displayName == null)
            {
                throw new ArgumentNullException(nameof(displayName));
            }
            if (email == null)
            {
                throw new ArgumentNullException(nameof(email));
            }

            return(new LocalUser
            {
                Id = id,
                PasswordHash = passwordHash,
                DisplayName = displayName,
                Email = email
            });
        }