本文整理汇总了C#中ICustomer.SerializeToXml方法的典型用法代码示例。如果您正苦于以下问题:C# ICustomer.SerializeToXml方法的具体用法?C# ICustomer.SerializeToXml怎么用?C# ICustomer.SerializeToXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICustomer
的用法示例。
在下文中一共展示了ICustomer.SerializeToXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReindexCustomer
///// <summary>
///// Searches CustomerIndex by first name, last name, login name and email address for the 'term' passed
///// </summary>
///// <param name="term">Searches the customer index for a term</param>
///// <returns>A collection of <see cref="CustomerDisplay"/></returns>
//public static IEnumerable<CustomerDisplay> Search(string term)
//{
// var criteria = ExamineManager.Instance.CreateSearchCriteria();
// criteria.GroupedOr(
// new[] { "loginName", "firstName", "lastName", "email" },
// term.ToSearchTerms().Select(x => x.SearchTermType == SearchTermType.SingleWord ? x.Term.Fuzzy() : x.Term.MultipleCharacterWildcard()).ToArray());
// return Search(criteria);
//}
///// <summary>
///// Searches CustomerIndex using <see cref="ISearchCriteria"/> passed
///// </summary>
///// <param name="criteria">
///// The criteria.
///// </param>
///// <returns>
///// A collection of <see cref="CustomerDisplay"/>
///// </returns>
//public static IEnumerable<CustomerDisplay> Search(ISearchCriteria criteria)
//{
// return ExamineManager.Instance.SearchProviderCollection[SearcherName]
// .Search(criteria).OrderByDescending(x => x.Score)
// .Select(result => result.ToCustomerDisplay());
//}
/// <summary>
/// Re-indexes a customer.
/// </summary>
/// <param name="customer">
/// The customer to re-index
/// </param>
private static void ReindexCustomer(ICustomer customer)
{
ExamineManager.Instance.IndexProviderCollection[IndexName]
.ReIndexNode(customer.SerializeToXml().Root, IndexTypes.Customer);
}
示例2: AddCustomerToIndex
/// <summary>
/// Adds the customer to the index
/// </summary>
/// <param name="customer">The <see cref="ICustomer"/> to be indexed</param>
/// <remarks>For testing</remarks>
internal void AddCustomerToIndex(ICustomer customer)
{
var nodes = new List<XElement> { customer.SerializeToXml().Root };
AddNodesToIndex(nodes, IndexTypes.Customer);
}