当前位置: 首页>>代码示例>>C#>>正文


C# MongoRepository.Drop方法代码示例

本文整理汇总了C#中MongoRepository.Drop方法的典型用法代码示例。如果您正苦于以下问题:C# MongoRepository.Drop方法的具体用法?C# MongoRepository.Drop怎么用?C# MongoRepository.Drop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MongoRepository的用法示例。


在下文中一共展示了MongoRepository.Drop方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Drop_IfHaveCollection_ReturnTrue

 public void Drop_IfHaveCollection_ReturnTrue()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Insert(TestModel.CreateInstance());
     var result = repository.Drop();
     Assert.IsTrue(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:7,代码来源:MongoRepositoryTests.cs

示例2: ExistsUniqueItem_Own_ReturnItem

 public void ExistsUniqueItem_Own_ReturnItem()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = TestModel.CreateInstance();
     repository.Insert(item);
     item.IntValue = 5;
     var result = repository.ExistsUniqueItem(item);
     Assert.IsFalse(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例3: ExistsUniqueItem_OnlySelf_ReturnNull

 public void ExistsUniqueItem_OnlySelf_ReturnNull()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = new TestModel { StringValue = "sinan" };
     var item2 = new TestModel { StringValue = "sinan" };
     repository.Insert(item);
     var result = repository.ExistsUniqueItem(item2);
     Assert.IsTrue(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例4: AsQueryable_InserThreeItem_ReturnTwo

 public void AsQueryable_InserThreeItem_ReturnTwo()
 {
     var repository = new MongoRepository<TestModel4>();
     repository.Drop();
     repository.Insert(new TestModel4 { StringValue = "sinan" });
     repository.Insert(new TestModel4 { StringValue = "sinan" });
     repository.Insert(new TestModel4 { StringValue = "ali" });
     var list = repository.AsQueryable().Where(x => x.StringValue == "sinan");
     Assert.AreEqual(2, list.Count());
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例5: ExistsUniqueItem_SelfAndWithOtherProperties_ReturnNull

 public void ExistsUniqueItem_SelfAndWithOtherProperties_ReturnNull()
 {
     var repository = new MongoRepository<TestModel3>();
     repository.Drop();
     var item = new TestModel3 { StringValue = "sinan", StringValue2 = "akyazıcı", DateTimeValue = DateTime.Parse("01/01/1967") };
     var item2 = new TestModel3 { StringValue = "sinan", StringValue2 = "akyazıcı", DateTimeValue = DateTime.Parse("01/01/1967") };
     repository.Insert(item);
     var result = repository.ExistsUniqueItem(item2);
     Assert.IsTrue(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例6: Drop_IfDontHaveCollection_ReturnFalse

 public void Drop_IfDontHaveCollection_ReturnFalse()
 {
     var repository = new MongoRepository<TestModel>();
     var result = repository.Drop();
     Assert.IsFalse(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:6,代码来源:MongoRepositoryTests.cs

示例7: Save_IfHaveTheSameRecord_ReturnNull

 public void Save_IfHaveTheSameRecord_ReturnNull()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = TestModel.CreateInstance();
     repository.Insert(item);
     repository.Insert(new TestModel { StringValue = "sinan" });
     item.StringValue = "sinan";
     var res3 = repository.Save(item);
     Assert.IsNull(res3);
 }
开发者ID:aderman,项目名称:Doco,代码行数:11,代码来源:MongoRepositoryTests.cs

示例8: Save_IfDontHaveTheSameRecord_ReturnItem

 public void Save_IfDontHaveTheSameRecord_ReturnItem()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = TestModel.CreateInstance();
     var res = repository.Insert(item);
     item.StringValue2 = "sinan";
     var res2 = repository.Save(item);
     Assert.IsNotNull(res2);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例9: Insert_IfHaveTheSameRecord_ReturnNull

 public void Insert_IfHaveTheSameRecord_ReturnNull()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = TestModel.CreateInstance();
     var item2 = TestModel.CreateInstance();
     var res = repository.Insert(item);
     var res2 = repository.Insert(item2);
     Assert.IsNull(res2);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例10: GetItemsByQuery_InserThreeItem_ReturnTwo

 public void GetItemsByQuery_InserThreeItem_ReturnTwo()
 {
     var repository = new MongoRepository<TestModel4>();
     repository.Drop();
     repository.Insert(new TestModel4 { StringValue = "sinan" });
     repository.Insert(new TestModel4 { StringValue = "sinan" });
     repository.Insert(new TestModel4 { StringValue = "ali" });
     var list = repository.GetItemsByQuery(Query.EQ("StringValue", "sinan"));
     Assert.AreEqual(2, list.Count());
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例11: GetItemById_SendObjectId_ReturnItem

 public void GetItemById_SendObjectId_ReturnItem()
 {
     var repository = new MongoRepository<TestModel>();
     repository.Drop();
     var item = TestModel.CreateInstance();
     repository.Insert(item);
     var res = repository.GetItemById(item.Id);
     Assert.IsNotNull(res);
 }
开发者ID:aderman,项目名称:Doco,代码行数:9,代码来源:MongoRepositoryTests.cs

示例12: GetAll_InserTwoItem_ReturnTwo

 public void GetAll_InserTwoItem_ReturnTwo()
 {
     var repository = new MongoRepository<TestModel4>();
     repository.Drop();
     repository.Insert(new TestModel4());
     repository.Insert(new TestModel4());
     var list = repository.GetAll();
     Assert.AreEqual(2, list.Count());
 }
开发者ID:aderman,项目名称:Doco,代码行数:9,代码来源:MongoRepositoryTests.cs

示例13: ExistsUniqueItem_WithOutBsonUnique_ReturnItem

 public void ExistsUniqueItem_WithOutBsonUnique_ReturnItem()
 {
     var repository = new MongoRepository<TestModel4>();
     repository.Drop();
     var item = new TestModel4 { StringValue = "sinan", StringValue2 = "akyazıcı", DateTimeValue = DateTime.Parse("01/01/1967") };
     var item2 = new TestModel4 { StringValue = "sinan", StringValue2 = "akyazıcıx", DateTimeValue = DateTime.Parse("02/01/1967") };
     repository.Insert(item);
     var result = repository.ExistsUniqueItem(item2);
     Assert.IsFalse(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs

示例14: ExistsUniqueItem_WithOtherProperties_ReturnNull

 public void ExistsUniqueItem_WithOtherProperties_ReturnNull()
 {
     var repository = new MongoRepository<TestModel2>();
     repository.Drop();
     var item = new TestModel2 { StringValue = "sinan", StringValue2 = "akyazıcı", IntValue = 5 };
     var item2 = new TestModel2 { StringValue = "sinan", StringValue2 = "akyazıcı", IntValue = 5 };
     repository.Insert(item);
     var result = repository.ExistsUniqueItem(item2);
     Assert.IsTrue(result);
 }
开发者ID:aderman,项目名称:Doco,代码行数:10,代码来源:MongoRepositoryTests.cs


注:本文中的MongoRepository.Drop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。