/// <summary>
 /// Initializes a new instance of the <see cref="ProductFilterGroup"/> class.
 /// </summary>
 /// <param name="collection">
 /// The collection.
 /// </param>
 public ProductFilterGroup(IEntityFilterGroup collection)
 {
     this.Key       = collection.Key;
     this.Name      = collection.Name;
     this.SortOrder = collection.SortOrder;
     this.Initialize(collection.Filters, collection.ProviderKey);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProductFilterGroup"/> class.
 /// </summary>
 /// <param name="collection">
 /// The collection.
 /// </param>
 public ProductFilterGroup(IEntityFilterGroup collection)
 {
     this.Key = collection.Key;
     this.Name = collection.Name;
     this.SortOrder = collection.SortOrder;
     this.Initialize(collection.Filters, collection.ProviderKey);
     this.ExtendedData = collection.ExtendedData;
 }
 /// <summary>
 /// Maps <see cref="IEntityFilterGroup"/> to <see cref="IProductFilterGroup"/>.
 /// </summary>
 /// <param name="group">
 /// The entity filter group.
 /// </param>
 /// <returns>
 /// The <see cref="IProductFilterGroup"/>.
 /// </returns>
 private static IProductFilterGroup Map(IEntityFilterGroup group)
 {
     return group.EntityTfKey == Constants.TypeFieldKeys.Entity.ProductKey && group.IsFilter ?
         new ProductFilterGroup(group) :
         null;
 }
Esempio n. 4
0
 /// <summary>
 /// Maps <see cref="IEntityFilterGroup"/> to <see cref="IProductFilterGroup"/>.
 /// </summary>
 /// <param name="group">
 /// The entity filter group.
 /// </param>
 /// <returns>
 /// The <see cref="IProductFilterGroup"/>.
 /// </returns>
 private static IProductFilterGroup Map(IEntityFilterGroup group)
 {
     return(group.EntityTfKey == Constants.TypeFieldKeys.Entity.ProductKey && group.IsFilter ?
            new ProductFilterGroup(group) :
            null);
 }
 /// <summary>
 /// The resolve core.
 /// </summary>
 /// <param name="source">
 /// The source.
 /// </param>
 /// <returns>
 /// The <see cref="IEnumerable{EntityCollectionDisplay}"/>.
 /// </returns>
 protected override IEnumerable <EntityCollectionDisplay> ResolveCore(IEntityFilterGroup source)
 {
     return(!source.Filters.Any() ?
            Enumerable.Empty <EntityCollectionDisplay>() :
            source.Filters.Select(x => x.ToEntityCollectionDisplay()).OrderBy(x => x.SortOrder));
 }
 /// <summary>
 /// Maps <see cref="IEntityFilterGroup"/> to <see cref="EntityFilterGroupDisplay"/>.
 /// </summary>
 /// <param name="collection">
 /// The collection.
 /// </param>
 /// <returns>
 /// The <see cref="EntityFilterGroupDisplay"/>.
 /// </returns>
 public static EntityFilterGroupDisplay ToEntitySpecificationCollectionDisplay(this IEntityFilterGroup collection)
 {
     return(AutoMapper.Mapper.Map <EntityFilterGroupDisplay>(collection));
 }