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


C# SearchModel.PropertiesToSearch方法代码示例

本文整理汇总了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]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:21,代码来源:SearchTest.cs

示例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);
 }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:10,代码来源:BatchStamprApiClient.cs

示例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);
 }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:8,代码来源:BatchStamprApiClient.cs

示例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]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:13,代码来源:SearchTest.cs

示例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]);
        }
开发者ID:stampr,项目名称:stampr-api-csharp,代码行数:14,代码来源:SearchTest.cs


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