this is currently what I'm doing .. to avoid the exception I'll get
when i send this back over the wire (because Ticket is lazy loaded)
i'm setting it to null to even prevent the loading.
Obviously this entity is part of a bidirectional relationship, and
when I query Tickets I want the Callbacks collection to come back as
well, but I need to query ONLY callbacks to provide an alert section
to the user notifying them of these callbacks without the entire
ticket graph.
There must be a better way? It would seem that perhaps a Projection
which eliminates only the ticket would be an option, but I'm not very
sure if that's true, nor how to go about doing it.
public IEnumerable<TechSupportCallback>()
{
var rValue = Enumerable.Empty<TechSupportCallback>();
using (var session =
AegisDataContext.Current.SessionManager.OpenSession())
{
using (var trans = session.BeginTransaction())
{
var cbs =
session.CreateCriteria<TechSupportCallback>()
.Add(
nhc.Expression.In("GroupID", groupIDs)
|| nhc.Expression.Eq("UserIDScheduled",
userID))
.List<TechSupportCallback>();
rValue = cbs;
trans.Commit();
}
}
foreach(var callback in rValue)
{
callback.Ticket = null;
}
return rValue;
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.