public static QuantityTypeReadModel ToReadModel(this QuantityType quantityType) { return(new QuantityTypeReadModel( (int)quantityType, quantityType.ToString(), quantityType.GetAttribute <DefaultQuantityAttribute>().DefaultQuantity, quantityType.GetAttribute <PriceLabelAttribute>().PriceLabel, quantityType.GetAttribute <QuantityLabelAttribute>().QuantityLabel, quantityType.GetAttribute <QuantityNormalizerAttribute>().Value)); }