private IQueryable <PersonalView> GetViews(ViewsDataContext dc, Guid fromId, IEnumerable <Guid> toIds, DateTime minSentTime) { dc.LoadOptions = ContactLoadOptions; var args = new GetContactsArgs { FromId = fromId, ToIds = new SplitList <Guid>(toIds.Distinct()).ToString(), MinLastSentTime = minSentTime }; return(GetViewsQuery(dc, args, _locationQuery)); }
private static IEnumerable <PersonalView> GetViews(ViewsDataContext dc, Guid fromId, IEnumerable <Member> tos, DateTime minSentTime) { dc.LoadOptions = ContactLoadOptions; var args = new GetContactsArgs { FromId = fromId, ToIds = new SplitList <Guid>((from to in tos select to.Id).Distinct()).ToString(), MinLastSentTime = minSentTime }; var contactDegrees = GetContactDegreesQuery(dc, args).ToDictionary(c => c.Item1, c => c.Item2); return(from to in tos let c = (contactDegrees.ContainsKey(to.Id) ? contactDegrees[to.Id] : new Tuple <PersonalContactDegree, PersonalContactDegree>(PersonalContactDegree.Public, PersonalContactDegree.Public)) select new PersonalView(to, c.Item1, c.Item2)); }