本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例6: Drop_IfDontHaveCollection_ReturnFalse
public void Drop_IfDontHaveCollection_ReturnFalse()
{
var repository = new MongoRepository<TestModel>();
var result = repository.Drop();
Assert.IsFalse(result);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}