本文整理汇总了C#中SearchModel.PropertiesToSearch方法的典型用法代码示例。如果您正苦于以下问题:C# SearchModel.PropertiesToSearch方法的具体用法?C# SearchModel.PropertiesToSearch怎么用?C# SearchModel.PropertiesToSearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchModel
的用法示例。
在下文中一共展示了SearchModel.PropertiesToSearch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSearchValidAll
public void TestSearchValidAll()
{
DateTime date = DateTime.Now;
SearchModel<Status> model = new SearchModel<Status>()
{
Status = Status.hold,
End = date.AddMinutes(5),
Start = date,
Paging = 10
};
SearchValidationResult res = model.IsValidSearchCombination();
Assert.True(res.IsValid);
string[] searchArray = model.PropertiesToSearch();
Assert.AreEqual("with", searchArray[0]);
Assert.AreEqual(Status.hold.ToString(), searchArray[1]);
Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[2]);
Assert.AreEqual(date.ToUniversalTime().AddMinutes(5).ToString(_dateFormat), searchArray[3]);
Assert.AreEqual("10", searchArray[4]);
}
示例2: GetBatchMailings
public MailingModel[] GetBatchMailings(int id, SearchModel<MailingStatus> searchModel)
{
List<string> props = new List<string>();
props.Add(_batchRelatedUri);
props.Add(id.ToString());
props.Add(_mailingRelatedUri);
props.AddRange(searchModel.PropertiesToSearch());
string relatedUri = JoinRelativeUri(props.ToArray());
return GetMailingModels<MailingModel>(relatedUri);
}
示例3: GetBatches
public BatchModel[] GetBatches(SearchModel<Status> searchModel)
{
List<string> props = new List<string>();
props.Add(_batchRelatedUri);
props.AddRange(searchModel.PropertiesToSearch());
string relatedUri = JoinRelativeUri(props.ToArray());
return GetModels<BatchModel>(relatedUri);
}
示例4: TestSearchValidStatus
public void TestSearchValidStatus()
{
SearchModel<Status> model = new SearchModel<Status>()
{
Status = Status.hold
};
SearchValidationResult res = model.IsValidSearchCombination();
Assert.True(res.IsValid);
string[] searchArray = model.PropertiesToSearch();
Assert.AreEqual("with", searchArray[0]);
Assert.AreEqual(Status.hold.ToString(), searchArray[1]);
}
示例5: TestSearchValidStartTime
public void TestSearchValidStartTime()
{
DateTime date = DateTime.Now;
SearchModel<Status> model = new SearchModel<Status>()
{
Start = date
};
SearchValidationResult res = model.IsValidSearchCombination();
Assert.True(res.IsValid);
string[] searchArray = model.PropertiesToSearch();
Assert.AreEqual("browse", searchArray[0]);
Assert.AreEqual(date.ToUniversalTime().ToString(_dateFormat), searchArray[1]);
}