Exemplo n.º 1
0
 public static void Merge(this ILinqToHqlGeneratorsRegistry registry, IHqlGeneratorForProperty generator)
 {
     if (registry == null)
     {
         throw new ArgumentNullException("registry");
     }
     if (generator == null)
     {
         throw new ArgumentNullException("generator");
     }
     Array.ForEach(generator.SupportedProperties.ToArray(), property => registry.RegisterGenerator(property, generator));
 }
		public static void Merge(this ILinqToHqlGeneratorsRegistry registry, IHqlGeneratorForProperty generator)
		{
			if (registry == null)
			{
				throw new ArgumentNullException("registry");
			}
			if (generator == null)
			{
				throw new ArgumentNullException("generator");
			}
			Array.ForEach(generator.SupportedProperties.ToArray(), property => registry.RegisterGenerator(property, generator));
		}
        /// <summary>
        /// Should pre-evaluation be allowed for this property?
        /// </summary>
        /// <param name="generator">The property's HQL generator.</param>
        /// <param name="member">The property.</param>
        /// <param name="factory">The session factory.</param>
        /// <returns>
        /// <see langword="true" /> if the property should be evaluated before running the query whenever possible,
        /// <see langword="false" /> if it must always be translated to the equivalent HQL call.
        /// </returns>
        public static bool AllowPreEvaluation(
            this IHqlGeneratorForProperty generator,
            MemberInfo member,
            ISessionFactoryImplementor factory)
        {
            if (generator is IAllowPreEvaluationHqlGenerator allowPreEvalGenerator)
            {
                return(allowPreEvalGenerator.AllowPreEvaluation(member, factory));
            }

            // By default, everything should be pre-evaluated whenever possible.
            return(true);
        }
 public static void Merge(this ILinqToHqlGeneratorsRegistry registry, IHqlGeneratorForProperty generator)
 {
     if (registry == null)
     {
         throw new ArgumentNullException("registry");
     }
     if (generator == null)
     {
         throw new ArgumentNullException("generator");
     }
     foreach (var property in generator.SupportedProperties)
     {
         registry.RegisterGenerator(property, generator);
     }
 }
		public static void Merge(this ILinqToHqlGeneratorsRegistry registry, IHqlGeneratorForProperty generator)
		{
			if (registry == null)
			{
				throw new ArgumentNullException("registry");
			}
			if (generator == null)
			{
				throw new ArgumentNullException("generator");
			}
			foreach (var property in generator.SupportedProperties)
			{
				registry.RegisterGenerator(property, generator);
			}
		}
		public virtual void RegisterGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
		{
			registeredProperties.Add(property, generator);
		}
		public virtual bool TryGetGenerator(MemberInfo property, out IHqlGeneratorForProperty generator)
		{
			return registeredProperties.TryGetValue(property, out generator);
		}
 public virtual void RegisterGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
 {
     registeredProperties.Add(property, generator);
 }
 public virtual bool TryGetGenerator(MemberInfo property, out IHqlGeneratorForProperty generator)
 {
     return(registeredProperties.TryGetValue(property, out generator));
 }
 public void RegisterGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
 {
     throw new NotImplementedException();
 }
 public bool TryGetGenerator(MemberInfo property, out IHqlGeneratorForProperty generator)
 {
     throw new NotImplementedException();
 }
			public void RegisterGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
			{
				throw new NotImplementedException();
			}
			public bool TryGetGenerator(MemberInfo property, out IHqlGeneratorForProperty generator)
			{
				throw new NotImplementedException();
			}