- Timestamp:
- 06/10/13 16:32:19 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Billing/Model/Model.cs
r9586 r9602 1 using System; 1 2 using System; 2 3 using System.Collections.Generic; 4 namespace HeuristicLab.Services.Optimization.Billing.Model { 3 5 4 namespace HeuristicLab.Services.Optimization.Billing.Model { 6 /* 7 * Note: enum support 8 * Although we use EF5 enums are not supported as we target .NET 4.0. 9 * Therefor we use the following workaround: 10 * Just create an int property on your class to represent the int value of the enum. 11 * That's the property that EF should map, then have a "mini wrapper" property to allow you to use the enum 12 * For example see class PaymentInformation 13 * See also: http://stackoverflow.com/questions/6344032/enums-with-ef-code-first-standard-method-to-seeding-db-and-then-using 14 */ 15 5 16 public class ContactInformation { 6 17 public long ContactInformationId { get; set; } … … 17 28 public class PaymentInformation { 18 29 public long PaymentInformationId { get; set; } 30 public long UserId { get; set; } 19 31 public string CardNumber { get; set; } 20 public PaymentMethod PaymentMethod{ get; set; }32 public int PaymentMethodValue { get; set; } 21 33 public string AdditionalInformation { get; set; } 34 35 public virtual User User { get; set; } 36 37 public PaymentMethod PaymentMethod { 38 get { return (PaymentMethod)PaymentMethodValue; } 39 set { PaymentMethodValue = (int)value; } 40 } 22 41 } 23 42 … … 52 71 public long UserId { get; set; } 53 72 public string Name { get; set; } 73 54 74 public virtual IList<PaymentInformation> PaymentInformation { get; set; } 75 55 76 } 56 77 … … 66 87 public long OrderId { get; set; } 67 88 public long UserId { get; set; } 68 public BillingType BillingType { get; set; }69 public long OrderStateId{ get; set; }70 public BillingPeriod BillingPeriod{ get; set; }89 public int StateValue { get; set; } 90 public int BillingTypeValue { get; set; } 91 public int BillingPeriodValue { get; set; } 71 92 public DateTime? ActiveSince { get; set; } 72 93 public DateTime? ActiveUntil { get; set; } 73 94 74 75 95 public virtual User User { get; set; } 76 public virtual OrderState State { get; set; }77 96 public virtual IList<Invoice> Invoices { get; set; } 78 97 public virtual IList<OrderLine> OrderLines { get; set; } 98 99 public OrderState State { 100 get { return (OrderState)StateValue; } 101 set { StateValue = (int)value; } 102 } 103 public BillingType BillingType { 104 get { return (BillingType)BillingTypeValue; } 105 set { BillingTypeValue = (int)value; } 106 } 107 public BillingPeriod BillingPeriod { 108 get { return (BillingPeriod)BillingPeriodValue; } 109 set { BillingPeriodValue = (int)value; } 110 } 79 111 } 80 112 … … 99 131 public long OrderId { get; set; } 100 132 public DateTime Due { get; set; } 101 public InvoiceStatus Status{ get; set; }133 public int StatusValue { get; set; } 102 134 public string InvoiceDocument { get; set; } 103 135 … … 105 137 public virtual Order Order { get; set; } 106 138 public virtual IList<InvoiceLine> InvoiceLines { get; set; } 139 140 public InvoiceStatus Status { 141 get { return (InvoiceStatus)StatusValue; } 142 set { StatusValue = (int)value; } 143 } 107 144 } 108 145
Note: See TracChangeset
for help on using the changeset viewer.