因此,当涉及到属性等数据时,我们有Order
哪个是逻辑,哪个连接视图和逻辑。具有枚举和. 如何在不知道逻辑或视图的接口层的情况下创建属性和属性?IOrderData
Order
PayMethod
OrderStatus
PayMethod
OrderStatus
IOrderData
例子:
项目逻辑:
public class Order : IOrder, IOrderData
{
public enum PayMethod
{
iDeal,
creditcard,
PayPal
}
public enum OrderStatus
{
NotPaid,
InTheMaking,
Shipped,
Delivered,
Confirmed
}
public OrderStatus Status { get; set; }
public PayMethod Paymethod { get; set; }
项目数据接口:
public interface IOrderData
{
public OrderStatus Status { get; set; } //doesn't work
public PayMethod Paymethod { get; set; } //doesn't work
}
Enums
我的解决方案:我刚刚为使用枚举的类PayMethod
和任何地方创建了一个新的类库,OrderStatus
我提到了类库。