Custom Attributes with Lambda Expressions

I am intrigued by a comment made by Anders on the LINQ panel, to the effect that LINQ empowers rule and notification systems. Such systems are likely to use custom attributes to capture the rule or trigger expression. This in turn demands that custom attributes should supportFunc<> as a property type.

Here is a hypothetical example of its application in DLINQ.

[Table]
public class Customer
{
[Column]
public string FirstName;

private EntitySet<Order> _ActiveOrders;

#region hypothetical - does not work
/// The active orders for this customer.
[Association(
Storage=Customer._Orders,
Bind=((c,o) => c.CustomerID==o.CustomerID
&& o.Status==OrderStatus.Active))]

public EntitySet<Order> ActiveOrders;
#endregion
}

In this example,OtherKey is unnecessary. Also, I pretend that theStorage property can be specified literally, but that's another subject.

A concern of mine with such an expression is that it is difficult to parameterize. Presumably DLINQ would fail if a property was referenced that was not mapped to a column.

[1320 byte] By [EronWright] at [2008-2-6]

Visual Studio Orcas

Site Classified