コードファーストを使用してEntityFrameworkを使用するアプリケーションを作成しています。いくつかのモデルを作成しましたが、先に進む前に、いくつかのことを確認したいと思います。私が作成したモデルは、製品、顧客、注文などのためのものです。また、住所など、型として使用しているモデルもいくつか作成しました。例えば:
public class Customer
{
public int CustomerID { get; set; }
public string CustomerName { get; set; }
public string CustomerEmail { get; set; }
public string PhoneNumber { get; set; }
public Address ShippingAddress { get; set; }
public Address BillingAddress { get; set; }
}
public class Address
{
public string AddressLineOne { get; set; }
public string AddressLineTwo { get; set; }
public string Company { get; set; }
public string City { get; set; }
public string State { get; set; }
public int ZipCode { get; set; }
public string Country { get; set; }
}
これは、ShipToAddress、ShipToStateなどの個々のプロパティを作成するよりも望ましいですか?私はWeb開発にかなり慣れていないので、これによって引き起こされるいくつかの問題のために、これを最初からやり直す必要はありません。事前にご協力いただきありがとうございます。十分に明確になっていない場合は、事前にお詫び申し上げます。