0
Reply

query as dlinq type attribute

Andrus

Andrus

16 years ago
1.8k

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