コード例 #1
0
ファイル: OptionsGet.cs プロジェクト: Krusen/Glass.Mapper
        public override void Validate()
        {
            if (ConstructorParameters != null && ConstructorParameters.Count > 10)
            {
                throw new NotSupportedException("Too many parameters added. Maximum 10 constructor parameters");
            }

            if (ConstructorParameters.Any(x => x == null))
            {
                throw new NotSupportedException("Constructor parameters cannot be null");
            }

            if (Type == null)
            {
                throw new NullReferenceException("No Type defined");
            }
        }
コード例 #2
0
        public override void Validate()
        {
            if (ConstructorParameters != null && ConstructorParameters.Count > 10)
            {
                throw new NotSupportedException("Too many parameters added. Maximum 10 constructor parameters");
            }

            if (ConstructorParameters.Any(x => x == null))
            {
                throw new NotSupportedException("Constructor parameters cannot be null");
            }

            if (Type == null)
            {
                throw new NullReferenceException("No Type defined");
            }

            if (Cache.IsEnabled() && Lazy != LazyLoading.Disabled)
            {
                throw new NotSupportedException("Both Cache and IsLazy cannot be true. Cached models cannot lazy load.");
            }
        }