As new to Ling having a bit of a problem see how you do the following query
I want all topics which have a subscription with an ApplicationName of "name"
Topic -> Subscriptions -> Subscription
started to write
var topics = from topic in Query.All<topic>() where topic.Subscriptions...... not clear how to continue
I think I missing something pretty basic, could you point me in the right direction
[HierarchyRoot]
[Index("Name")]
public class Topic : Entity {
[Field, Key]
public long Id { get; private set; }
[Field]
public string Name { get; set; }
[Field, Association(PairTo = "Topic", OnTargetRemove = OnRemoveAction.Clear)]
public EntitySet<Event> Events { get; private set; }
[Field, Association(OnTargetRemove = OnRemoveAction.Clear)]
public EntitySet<Subscription> Subscriptions { get; private set; }
}
[HierarchyRoot]
[Index("TimeStamp")]
[Index("ApplicationName")]
public class Event : Entity {
public Event() {
TimeStamp = DateTime.Now;
}
[Field, Key]
public long Id { get; private set; }
[Field]
public DateTime TimeStamp { get; private set; }
[Field]
public String ApplicationName { get; set; }
[Field]
public Topic Topic { get; set; }
}
[HierarchyRoot]
[Index("ApplicationName")]
public class Subscription : Entity {
[Field, Key]
public long Id { get; private set; }
[Field]
public string ApplicationName { get; set; }
[Field]
public bool Persistent { get; set; }
[Field]
public Event LastEvent { get; set; }
}
This thread was imported from our support forum. The original discussion may contain more detailed answer.
asked
Dec 23 '09 at 17:14
Tony
53●26●26●28