Code: Select all
public static IQueryable Current(this IQueryable source)
{
var entParam = Expression.Parameter(typeof(TSource), "ent");
var entParam2 = Expression.Parameter(typeof(TSource), "ent");
return source
.Where(
Expression.Lambda>(
Expression.Equal(Expression.Property(entParam, typeof(TSource).GetProperty("EntityId")),
Expression.Constant(0L)), new[] { entParam }))
.Where(
Expression.Lambda>(
Expression.Equal(Expression.Property(entParam2, typeof(TSource).GetProperty("RecordStatus")),
Expression.Constant(0L)), new[] { entParam2 }));
}
Code: Select all
var contacts = from c in DB.Contacts.Current()
where !(from u in DB.Users
select u.ContactId).Contains(c.Id)
select c.Id;
Code: Select all
var contacts = from c in DB.Contacts.Current()
where !(from u in DB.Users.Current()
select u.ContactId).Contains(c.Id)
select c.Id;
It seems that this should work both places since it's expression based. These two should be equivalent:Specified method is not supported.
at Devart.Data.Linq.Provider.Query.x.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.x.d(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.a(UnaryExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.a(Expression A_0, LambdaExpression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.d(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.i(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.GetCommand(Expression query)
at Devart.Data.Linq.DataContext.GetCommand(IQueryable query)
Code: Select all
var contacts = from c in DB.Contacts.Current()
where !(from u in DB.Users.Current()
select u.ContactId).Contains(c.Id)
select c.Id;
Code: Select all
var contacts = from c in DB.Contacts.Current()
where !(from u in DB.Users
where u.EntityId == 0 && e.RecordStatus == 0
select u.ContactId).Contains(c.Id)
select c.Id;
Code: Select all
SELECT t1.ID
FROM CONTACT t1
WHERE (NOT (EXISTS
(
SELECT t2.CONTACT_ID AS "ContactId"
FROM USERS t2
WHERE (t2.CONTACT_ID = t1.ID) AND (t2.ENTITY_ID = :p0) AND (t2.RECORD_STATUS = :p1)
)
)) AND (t1.RECORD_STATUS = :p2) AND (t1.ENTITY_ID = :p3)