internal EntityList(DataContext dataContext, EntityListItemsCollection <TEntity> itemsCollection, string listName, int rowLimit) { this.m_ListName = listName; this.Query = CamlQueryDefinition.CAMLAllItemsQuery(rowLimit); this.m_AllItemsCollection = itemsCollection; this.DataContext = dataContext; }
internal void LoadListItem <TEntity>(int fieldLookupValue, EntityListItemsCollection <TEntity> entityListItemsCollection) where TEntity : class, ITrackEntityState, ITrackOriginalValues, INotifyPropertyChanged, INotifyPropertyChanging, new() { GetListItemCollection(entityListItemsCollection.MyList, CamlQueryDefinition.GetCAMLSelectedID(fieldLookupValue), x => { foreach (ListItem _listItemx in x) { entityListItemsCollection.Add(_listItemx); } }); }
/// <summary> /// Gets the entities for reverse lookup. /// </summary> /// <param name="fieldName">Name of the field.</param> /// <param name="parentItemId">The parent item identifier.</param> /// <returns>Dictionary<System.Int32, Object>.</returns> Dictionary <int, Object> IEntityListItemsCollection.GetEntitiesForReverseLookup(string fieldName, int parentItemId) { Dictionary <int, Object> _ret = new Dictionary <int, Object>(); m_DataContext.GetListItemCollection(this.MyList, CamlQueryDefinition.GetCAMLSelectedLookup(parentItemId, fieldName, m_DataContext.RowLimit), _items => { foreach (ListItem _lix in _items) { if (m_Collection.ContainsKey(_lix.Id)) { _ret.Add(_lix.Id, m_Collection[_lix.Id].TEntityGetter); } else { _ret.Add(_lix.Id, this.Add(_lix)); } } ; }); return(_ret); }