0

したがって、次の ComplexType があります。

[ComplexType]
public class TransactionSettings
{
    [Display(Name = "Minimum Order Amount"), Column(TypeName = "MONEY")]
    public decimal MinimumOrder { get; set; }
    [Display(Name = "Payment Provider")]
    public PaymentProvider PaymentProvider { get; set; }
    [Display(Name = "Provider Settings")]
    public ProviderSettings ProviderSettings { get; set; }
    [Display(Name = "Accepted Credit Cards")]
    public CreditCards[] AcceptedCreditCards { get; set; }
    [Display(Name = "Taxable States")]
    public States[] SalesTaxStates { get; set; }
}

public enum CreditCards
{
    MasterCard,
    Visa,
    [Description("American Express")]
    AmericanExpress,
    Discover
}

public enum States
{
    [Description("Alabama")]
    AL,
    [Description("Alaska")]
    AK,
    [Description("Arizona")]
    AZ,
    //.
    //.
    //.
    [Description("Wisconsin")]
    WI,
    [Description("Wyoming")]
    WY
}

この配列は、特定のフィールドに複数の選択肢があることを示しています。しかし、ご存じのとおり、複合型にはプリミティブ プロパティしか含めることができません。では、どうすればこれを達成できますか?

4

1 に答える 1