Example #1
0
        /// <summary>
        /// Adds an administrator to the application.
        /// </summary>
        /// <param name="command">The command.</param>
        public virtual void AddAdministrator(AddAdministratorCommand command)
        {
            Guard.Will.ProtectAgainstNullArgument(() => command);

            if (Administrators.Any(admins => admins.Login.Equals(command.Login, StringComparison.OrdinalIgnoreCase)))
            {
                return;
            }

            var user = new User(command.Login);

            this.administrators.Add(user);
        }