/// <summary>
        /// Performs the actual obsoletion
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="data">Data.</param>
        public TData Obsolete(SQLiteDataContext context, TData data)
        {
            var retVal = this.ObsoleteInternal(context, data);

            //if (retVal != data) System.Diagnostics.Debugger.Break();
            context.AddCacheCommit(retVal);
            return(retVal);
        }
        /// <summary>
        /// Performs the actual query
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="query">Query.</param>
        public IEnumerable <TData> Query(SQLiteDataContext context, Expression <Func <TData, bool> > query, Guid queryId, int offset, int count, out int totalResults, bool countResults, ModelSort <TData>[] orderBy)
        {
            var retVal = this.QueryInternal(context, query, offset, count, out totalResults, queryId, countResults, orderBy);

            foreach (var i in retVal.Where(i => i != null))
            {
                context.AddCacheCommit(i);
            }

            return(retVal);
        }
        /// <summary>
        /// Perform the actual update.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="data">Data.</param>
        public TData Update(SQLiteDataContext context, TData data)
        {
            // JF- Probably no need to do this now
            // Make sure we're updating the right thing
            //if (data.Key.HasValue)
            //{
            //    var cacheItem = ApplicationContext.Current.GetService<IDataCachingService>()?.GetCacheItem(data.GetType(), data.Key.Value);
            //    if (cacheItem != null)
            //    {
            //        cacheItem.CopyObjectData(data);
            //        data = cacheItem as TData;
            //    }
            //}

            var retVal = this.UpdateInternal(context, data);

            //if (retVal != data) System.Diagnostics.Debugger.Break();
            context.AddCacheCommit(retVal);
            return(retVal);
        }