dotConnect for Zoho CRM - Linq to Entities Broken
Posted: Fri 20 Dec 2019 18:40
Finding issues with Linq to Entities similar to this topic. Using IQueryable extension methods for string properties gives inconsistent behavior depending on if a string literal or variable is used. For some string properties that are lookup fields it doesn't matter if a literal or variable is used for comparison. For numeric properties all are problematic.
In cases where it is broken it is acting like context.Entity.AsEnumerable() or context.Entity.Select(e=>e.property).AsEnumerable() and using Linq to Objects on the returned data set. A few examples are shown below, but this behavior is seen in all other extension methods as well. All examples should be able to be translated to a simple search records using an equals criteria as in the first example.
Query / Api Requests
var product = await context.Products.SingleOrDefaultAsync(p => p.Product_Code == "VB_VESA_AIR_BLK");
...
GET /crm/v2/Products/search?criteria=(Product_Code:equals:VB_VESA_AIR_BLK)&per_page=2&page=1
Query / Api Requests
var code = "VB_VESA_AIR_BLK";
var product = await context.Products.SingleOrDefaultAsync(p => p.Product_Code == code);
...
GET /crm/v2/Products?per_page=200&page=1
GET /crm/v2/Products?per_page=200&page=2
GET /crm/v2/Products?per_page=200&page=3
...
Query / Api Requests
var products = await context.Products.Where(p =>p.Owner == 1234).ToListAsync();
...
GET /crm/v2/Products?per_page=200&page=1
GET /crm/v2/Products?per_page=200&page=2
GET /crm/v2/Products?per_page=200&page=3
...
Query / Api Requests
var isModifiedByMe = await context.Products.AnyAsync(p => p.Modified_By_Name == "John Smith");
...
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=1
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=2
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=3
...
version: 1.9.1034
EF provider: Devart.Data.Zoho.Entity.EF6
In cases where it is broken it is acting like context.Entity.AsEnumerable() or context.Entity.Select(e=>e.property).AsEnumerable() and using Linq to Objects on the returned data set. A few examples are shown below, but this behavior is seen in all other extension methods as well. All examples should be able to be translated to a simple search records using an equals criteria as in the first example.
Query / Api Requests
var product = await context.Products.SingleOrDefaultAsync(p => p.Product_Code == "VB_VESA_AIR_BLK");
...
GET /crm/v2/Products/search?criteria=(Product_Code:equals:VB_VESA_AIR_BLK)&per_page=2&page=1
Query / Api Requests
var code = "VB_VESA_AIR_BLK";
var product = await context.Products.SingleOrDefaultAsync(p => p.Product_Code == code);
...
GET /crm/v2/Products?per_page=200&page=1
GET /crm/v2/Products?per_page=200&page=2
GET /crm/v2/Products?per_page=200&page=3
...
Query / Api Requests
var products = await context.Products.Where(p =>p.Owner == 1234).ToListAsync();
...
GET /crm/v2/Products?per_page=200&page=1
GET /crm/v2/Products?per_page=200&page=2
GET /crm/v2/Products?per_page=200&page=3
...
Query / Api Requests
var isModifiedByMe = await context.Products.AnyAsync(p => p.Modified_By_Name == "John Smith");
...
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=1
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=2
GET /crm/v2/Products?fields=Modified_By&per_page=200&page=3
...
version: 1.9.1034
EF provider: Devart.Data.Zoho.Entity.EF6