私はこの定義を持つクラスを持っています:
public class WebSiteContent
{
public Guid Id { get; set; }
public About About { get; set; }
public Tips Tips { get; set; }
public Images Images { get; set; }
}
私の概要とヒントと画像は次のようになります。
public class About
{
public Guid Id { get; set; }
public string Text { get; set; }
public string Addres { get; set; }
public int PhoneNumber { get; set; }
public int Mobile { get; set; }
}
とヒント:
public class Tips
{
public Guid Guid { get; set; }
public string Content { get; set; }
}
および画像:
public class Images
{
public Guid Id { get; set; }
public string Background { get; set; }
public string Logo { get; set; }
public About About { get; set; }
}
ここでは、プロパティを作成するためのヘルパー クラスとして about と Images と tips を使用したいだけで、データベースに about,Images または tips テーブルを持ちたくありません!
エンティティ フレームワークでは、上記のすべてのクラスをマップするために Id が必要ですが、どうすればよいですか?