Extending LINQ to Nhibernate provider, in combination with Dynamic LINQ problem

前端 未结 3 1958
春和景丽
春和景丽 2021-01-02 21:28

I\'m using NHibernate 3.1.0 and I\'m trying to extend the LINQ provider by using BaseHqlGeneratorForMethod and extending the DefaultLinqToHqlGeneratorsReg

3条回答
  •  借酒劲吻你
    2021-01-02 22:09

    Supposing the property Id of the class Project it's an Int32 try registering the corresponding Int32.ToString() method in your ToStringGenerator class.

    ...
    public ToStringGenerator()
    {
        SupportedMethods = new[]
            {
                ReflectionHelper.GetMethodDefinition(x => x.ToString()),
                ReflectionHelper.GetMethodDefinition(x => x.ToString()),
            };
    }
    ...
    
        

    提交回复
    热议问题