我首先尝试通过Google.Apis.YouTube.v3.Data.Channel创建代码。
我的代码:
modelBuilder.Entity<ChannelBrandingSettings>().Property(x => x.ETag);
modelBuilder.Entity<Google.Apis.YouTube.v3.Data.Channel>().Map(m =>
{
m.MapInheritedProperties();
m.ToTable("Youtube_Archieve");
});
但是当我尝试更新数据库时,我得到了错误:
YoutubeAdv.Models.ChannelBrandingSettings: : EntityType 'ChannelBrandingSettings' has no key defined. Define the key for this EntityType.
YoutubeAdv.Models.PropertyValue: : EntityType 'PropertyValue' has no key defined. Define the key for this EntityType.
YoutubeAdv.Models.ImageSettings: : EntityType 'ImageSettings' has no key defined. Define the key for this EntityType.
YoutubeAdv.Models.LocalizedProperty: : EntityType 'LocalizedProperty' has no key defined. Define the key for this EntityType.
YoutubeAdv.Models.LocalizedString: : EntityType 'LocalizedString' has no key defined. Define the key for this EntityType.