コード例 #1
0
        /// <summary>
        /// InMemory!
        /// </summary>
        /// <returns></returns>
        public static ITableSnapshotBuilder EmptySnapshot()
        {
            TableSnapshotBuilder b = new TableSnapshotBuilder();

            b.TableSnapshotDelegate = () =>
            {
                SqliteDatabaseProvider prov = SqliteDatabaseProvider.CreateInMemoryDatabase();
                RepositoryListSnapshotBuilder.CreateTable(prov);
                SqliteTableSnapshot ts = new SqliteTableSnapshot(prov, RepositoryTableSnapshot.TableName, RepositoryTableSnapshot.PrimaryKey);
                return(ts);
            };
            return(b);
        }
コード例 #2
0
        public static ITableSnapshotBuilder CreateInMemorySnapshotFromRequest(IEnumerable <string> jsonResponses)
        {
            Guard.ArgumentNotNull(jsonResponses, nameof(jsonResponses));
            TableSnapshotBuilder b = new TableSnapshotBuilder();

            b.TableSnapshotDelegate = () =>
            {
                SqliteDatabaseProvider prov = SqliteDatabaseProvider.CreateInMemoryDatabase();
                RepositoryListSnapshotBuilder.Fill(prov, jsonResponses);

                SqliteTableSnapshot ts = new SqliteTableSnapshot(prov, RepositoryTableSnapshot.TableName, RepositoryTableSnapshot.PrimaryKey);
                return(ts);
            };
            return(b);
        }