Пример #1
0
        /// <summary>
        /// Gets the actual System.Type of the entities in the collection.
        /// </summary>
        /// <param name="collection">
        /// The collection.
        /// </param>
        /// <returns>
        /// The <see cref="Type"/>.
        /// </returns>
        internal static Type TypeOfEntities(this IEntityCollection collection)
        {
            switch (collection.EntityType())
            {
            case Core.EntityType.Customer:
                return(typeof(ICustomer));

            case Core.EntityType.EntityCollection:
                return(typeof(IEntityCollection));

            case Core.EntityType.GatewayProvider:
                return(typeof(IGatewayProviderSettings));

            case Core.EntityType.Invoice:
                return(typeof(IInvoice));

            case Core.EntityType.ItemCache:
                return(typeof(IItemCache));

            case Core.EntityType.Order:
                return(typeof(IOrder));

            case Core.EntityType.Payment:
                return(typeof(IPayment));

            case Core.EntityType.Product:
                return(typeof(IProduct));

            case Core.EntityType.Shipment:
                return(typeof(IShipment));

            case Core.EntityType.Warehouse:
                return(typeof(IWarehouse));

            case Core.EntityType.WarehouseCatalog:
                return(typeof(IWarehouseCatalog));

            default:
                return(typeof(object));
            }
        }