public virtual void RegisterTo(Class @class)
        {
            // Business rules
            @class.Validation().NotNull("class");
            if (registrations.Where(x => x.Class.Id == @class.Id).Count() > 0)
            {
                throw new InvalidOperationException("You can not register a student to a class he already registered");
            }
            if (passedClasses.Where(x => x == @class.Id).Count() > 0)
            {
                throw new InvalidOperationException("You can not register a student to a class he already passed");
            }

            // State changes
            registrationSequence = registrationSequence.Next();
            registrations.Add(new Registration(this, registrationSequence.ToId(), @class));
        }
        public virtual void RegisterTo(Class @class)
        {
            // Business rules
            @class.Validation().NotNull("class");
            if (registrations.Where(x => x.ClassId == @class.Id).Count() > 0)
            {
                throw new InvalidOperationException("You can not register a student to a class he already registered");
            }
            if (passedClasses.Where(x => x == @class.Id).Count() > 0)
            {
                throw new InvalidOperationException("You can not register a student to a class he already passed");
            }

            // State changes
            ApplyEvent(new StudentRegisteredToClassEvent(Id, @class.Id, @class.credits));
        }