private static void StoreProduct(IDocumentSession session, string name, decimal price) { var product = new Product { Name = name, Price = price }; session.Store(product); session.SaveChanges(); }
private static void CreateProduct(string name, decimal price) { var documentStore = new DocumentStore { Url = "http://asus:8081/" }; documentStore.Initialize(); using (var session = documentStore.OpenSession()) { var product = new Product { Name = name, Price = price }; session.Store(product); session.SaveChanges(); } }
public void TestStoreProduct() { var documentStore = new EmbeddableDocumentStore { RunInMemory = true }; documentStore.Initialize(); using (var session = documentStore.OpenSession()) { var product = new Product { Name = "Test product", Price = 1m }; session.Store(product); session.SaveChanges(); } }
public static void CreateProduct(IAsyncDocumentSession session, string name, decimal price) { var entity = new Product { Name = name, Price = price }; session.Store(entity); }