Hi

I'm attempting to run a very simple query using the new linq provider:

from w in session.Query<Widget>()
where w.Key == Guid.Empty
select w

It is throwing an exception in the default clause of this switch
statement in the constructor of HqlIdent, as the typecode of type is
Object:

switch (System.Type.GetTypeCode(type))
{
        case TypeCode.Boolean:
                _node.Text = "bool";
                break;
        case TypeCode.Int32:
                _node.Text = "integer";
                break;
        case TypeCode.Decimal:
                _node.Text = "decimal";
                break;
        case TypeCode.DateTime:
                _node.Text = "datetime";
                break;
        case TypeCode.String:
                _node.Text = "string";
                break;
        default:
                throw new NotSupportedException(string.Format("Don't currently
support idents of type {0}", type.Name));
}

I appreciate Steve is doing a super-human job of cranking this
provider out, but I was wondering if (with a little guidance) I might
be able to add support for this scenario myself?

In that regard, what are the implications of adding this clause?:

        case TypeCode.Object:
                _node.Text = "guid";
                break;

It seems to allow my query to work as expected, and does not cause any
other tests to fail.

Cheers
Lee

Reply via email to