📄 order.cs
字号:
using System;
using System.Collections.Generic;
namespace Wrox.ProCSharp.EnterpriseServices
{
[Serializable]
public class Order
{
public static Order Create(string customerId, DateTime orderDate,
string shipAddress, string shipCity, string shipCountry)
{
return new Order()
{
CustomerId = customerId,
OrderDate = orderDate,
ShipAddress = shipAddress,
ShipCity = shipCity,
ShipCountry = shipCountry
};
}
public Order()
{
}
internal void SetOrderId(int orderId)
{
this.OrderId = orderId;
}
public void AddOrderLine(OrderLine orderLine)
{
orderLines.Add(orderLine);
}
private List<OrderLine> orderLines = new List<OrderLine>();
public int OrderId { get; private set; }
public string CustomerId { get; private set; }
public DateTime OrderDate { get; private set; }
public string ShipAddress { get; private set; }
public string ShipCity { get; private set; }
public string ShipCountry { get; private set; }
public OrderLine[] OrderLines
{
get
{
OrderLine[] ol = new OrderLine[orderLines.Count];
orderLines.CopyTo(ol);
return ol;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -