NotSupportedException when testing a Navigation Prop for NUL

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
PangoChris
Posts: 12
Joined: Mon 14 Sep 2009 20:11

NotSupportedException when testing a Navigation Prop for NUL

Post by PangoChris » Thu 08 Oct 2009 21:50

The following query throws a System.NotSupportedException, due to testing if p.Supplier is null:

Code: Select all

var results = from p in dc.Products
              select new
              {
                  ProductName = p.ProductName,
                  SupplierContactName = (p.Supplier != null ? p.Supplier.ContactName : "")
              };
I can make this query work by testing the foreign key for null instead of testing the navigation property:

Code: Select all

var results = from p in dc.Products
              select new
              {
                  ProductName = p.ProductName,
                  SupplierContactName = (p.SupplierID != null ? p.Supplier.ContactName : "")
              };

Microsoft's LINQ to SQL is able to do both forms of the query. I'm using dotConnet for Oracle v 5.25.44, VS 2008 Pro.

Thanks,
Chris


Stack Trace:
Unhandled Exception: System.NotSupportedException: Specified method is not supported.
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(ag A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0, SqlNode A_1)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(l A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(ac A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(ao A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(bo A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(a0 A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(aw A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(aw A_0)
at Devart.Data.Linq.Provider.Query.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.SqlFormatter.a(SqlNode A_0, CommandType& A_1)
at Devart.Data.Linq.Provider.DataProvider.a(e A_0, Type A_1, SqlNode A_2, IList`1 A_3)
at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.h(Expression A_0)
at Devart.Data.Linq.DataQuery`1.i()

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 12 Oct 2009 08:10

Thank you for the report.
I will let you know as soon as this functionality is implemented.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 16 Nov 2009 12:49

We have added the requested functionality. It will be available in the nearest build.

Post Reply