0
Answer

query as dlinq type attribute

Andrus

Andrus

16y
1.8k
1

I need to use lambda expressions or other way to
specify default query for dlinq entity type.
Code below causes compile error shown in comment.
How to fix ?

Andrus.

using System;
using System.Linq;

// '<' unexpected : attributes cannot be generic
[QueryAttribute<Supplier>(d=> d.Discriminator=="Domestics")]
class DomesticsSupplier {
  public string Discriminator { get; set; };
  public string Name { get; set; };
  }

class QueryAttribute<TEntity> : Attribute {
  IQueryable<TEntity> Query;
  internal QueryAttribute(IQueryable<TEntity> query) {
  Query = query;
  }
}

Next Recommended Forum