public void Merge(AgilityExperimentListing delta)
        {
            if (Items == null)
            {
                Items = new AgilityExperiment[0];
            }

            Dictionary <int, AgilityExperiment> items = Items.ToDictionary(i => i.ID);

            if (delta != null)
            {
                foreach (var ex in delta.Items)
                {
                    if (ex.Deleted)
                    {
                        items.Remove(ex.ID);
                    }
                    else
                    {
                        items[ex.ID] = ex;
                    }
                }

                this.LastAccessDate = delta.LastAccessDate;
            }

            Items = items.Values.ToArray();
        }
        public AgilityExperiment GetForPage(int pageID)
        {
            if (Items == null || Items.Length == 0)
            {
                return(null);
            }

            AgilityExperiment exp = Items.Where(e => e.PageID == pageID && e.IsCurrent).OrderBy(e => e.ID).FirstOrDefault();

            return(exp);
        }
        public AgilityExperiment GetExperiment(int experimentID)
        {
            if (Items == null || Items.Length == 0)
            {
                return(null);
            }

            AgilityExperiment exp = Items.FirstOrDefault(e => e.ID == experimentID);

            if (exp != null && exp.IsCurrent)
            {
                return(exp);
            }

            return(null);
        }