static Prepare() { EntityUnifier.Factory() .UseDefaultContext(Connection.CreateMongo("localhost", "bookdb")) .Register <Author>(collectionName: "Authors"); _preped = true; }
static Prepare() { var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\sql.json"); EntityUnifier.Factory() /* Use defualt context */ .UseDefaultContext(Connection.CreateSqlServer(config.Key1, config.Key2, config.Key3, config.Password)) .Register <Author>() .Register <Book>(b => b.Id); _preped = true; }
static Prepare() { var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\sql.json"); EntityUnifier.Factory() /* Use defualt context */ .UseDefaultContext(Connection.CreateSqlServer(config.Key1, config.Key2, config.Key3, config.Password), "sql-context") .Register <Author>() .UseDefaultContext(Connection.CreateMongo("localhost", "bookdb"), "mongo-context") .Register <AuthorMongo>(collectionName: "Authors"); _preped = true; }
static Prepare() { var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\cosmos.json"); EntityUnifier.Factory() .UseDefaultContext(Connection.CreateCosmos(config.Key1, config.Key2, "BookDB")) .Register <Author>("Author", o => o.Id) .SpecialKey("PartitionKey", TypeCatalogue.SpecialKey.PartitionKey) .Register <Book>("Books", o => o.Id) .SpecialKey("PartitionKey", TypeCatalogue.SpecialKey.PartitionKey); _preped = true; }
static Prepare() { var config = new JsonShell <ConnConfig>().Load(@"C:\Dev\Configs\dynamo.json"); EntityUnifier.Factory() .UseDefaultContext(Connection.CreateDynamo(config.Key1, config.Key2, TypeCatalogue.AmazonRegion.USEast2)) .Register <Author>(collectionName: "Authors") .SpecialKey("Id", TypeCatalogue.SpecialKey.PartitionKey) .Register <Books>(collectionName: "Books") .SpecialKey("PartKey", TypeCatalogue.SpecialKey.PartitionKey) .Register <Novel>(collectionName: "Novel") .SpecialKey("PartKey", TypeCatalogue.SpecialKey.PartitionKey) .SpecialKey("Id", TypeCatalogue.SpecialKey.SortKey); _preped = true; }
public static IBridge GetBridge() => EntityUnifier.Factory().Bridge("sql-context", "mongo-context");
public static ISchemaQuery <Book> SchemaQuery() => EntityUnifier.Factory().GetQueryService <ISchemaQuery <Book> >();
public static ISqlQuery SqlQuery() => EntityUnifier.Factory().GetQueryService <ISqlQuery>();
public static IWriteQuery <Author> SetQuery() => EntityUnifier.Factory().GetQueryService <IWriteQuery <Author> >();
public static IReadQuery <Author> GetQuery() => EntityUnifier.Factory().GetQueryService <IReadQuery <Author> >();
internal static ISchemaQuery <Novel> SchemaQuery() => EntityUnifier.Factory().GetQueryService <ISchemaQuery <Novel> >();
public static IReadQuery <Books> GetBooks() => EntityUnifier.Factory().GetQueryService <IReadQuery <Books> >();