本文整理汇总了C#中SearchModel.Count方法的典型用法代码示例。如果您正苦于以下问题:C# SearchModel.Count方法的具体用法?C# SearchModel.Count怎么用?C# SearchModel.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchModel
的用法示例。
在下文中一共展示了SearchModel.Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
public ActionResult Search(string name, string comm, string addr)
{
if (!Authenticate(checkOrgLeadersOnly: true))
return Content("not authorized");
Response.NoCache();
var m = new SearchModel(name, comm, addr);
return new SearchResult0(m.PeopleList(), m.Count());
}
示例2: SearchResults
public ActionResult SearchResults(string name, string comm, string addr)
{
if (!Authenticate(checkOrgLeadersOnly: true))
return Content("not authorized");
if (!CMSRoleProvider.provider.IsUserInRole(AccountModel.UserName2, "Access"))
return Content("not authorized");
Response.NoCache();
DbUtil.LogActivity($"iphone search '{name}'");
var m = new SearchModel(name, comm, addr);
return new SearchResult(m.PeopleList(), m.Count());
}
示例3: FetchPeople
public ActionResult FetchPeople(string data)
{
// Authenticate first
var result = AuthenticateUser();
if (!result.IsValid) return AuthorizationError(result);
BaseMessage dataIn = BaseMessage.createFromString(data);
MobilePostSearch mps = JsonConvert.DeserializeObject<MobilePostSearch>(dataIn.data);
BaseMessage br = new BaseMessage();
var m = new SearchModel(mps.name, mps.comm, mps.addr);
br.setNoError();
switch (dataIn.device)
{
case BaseMessage.API_DEVICE_ANDROID:
{
Dictionary<int, MobilePerson> mpl = new Dictionary<int, MobilePerson>();
MobilePerson mp;
foreach (var item in m.ApplySearch(mps.guest).OrderBy(p => p.Name2).Take(100))
{
mp = new MobilePerson().populate(item);
mpl.Add(mp.id, mp);
}
br.data = SerializeJSON(mpl, dataIn.version);
break;
}
case BaseMessage.API_DEVICE_IOS:
{
List<MobilePerson> mp = new List<MobilePerson>();
foreach (var item in m.ApplySearch(mps.guest).OrderBy(p => p.Name2).Take(100))
{
mp.Add(new MobilePerson().populate(item));
}
br.data = SerializeJSON(mp, dataIn.version);
break;
}
}
br.count = m.Count(mps.guest);
return br;
}