Syndication keys missing MVC

2019-08-12 12:58发布

问题:

Really need some help with this one.... I'm trying to get my MVC app to use the Syndication library for the RSS feed reader part of my program and got stuck while trying to enable migrations saying that:

RssProject.Models.SyndicationPerson: : EntityType 'SyndicationPerson' has no key     defined. Define the key for this EntityType.
RssProject.Models.SyndicationElementExtension: : EntityType 'SyndicationElementExtension' has no key defined. Define the key for this EntityType.
RssProject.Models.SyndicationCategory: : EntityType 'SyndicationCategory' has no key defined. Define the key for this EntityType.
RssProject.Models.SyndicationLink: : EntityType 'SyndicationLink' has no key defined. Define the key for this EntityType.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End 'SyndicationItem_Copyright_Target' could not be found in the containing EntityContainer.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End 'SyndicationFeed_Copyright_Target' could not be found in the containing EntityContainer.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End 'SyndicationFeed_Description_Target' could not be found in the containing EntityContainer.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End   'SyndicationFeed_Title_Target' could not be found in the containing EntityContainer.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End 'SyndicationItem_Summary_Target' could not be found in the containing EntityContainer.
SyndicationContents: : The referenced EntitySet 'SyndicationContents' for End 'SyndicationItem_Title_Target' could not be found in the containing EntityContainer.
SyndicationPersons: EntityType: EntitySet 'SyndicationPersons' is based on type 'SyndicationPerson' that has no keys defined.
SyndicationElementExtensions: EntityType: EntitySet 'SyndicationElementExtensions' is based on type 'SyndicationElementExtension' that has no keys defined.
SyndicationCategories: EntityType: EntitySet 'SyndicationCategories' is based on type 'SyndicationCategory' that has no keys defined.
SyndicationLinks: EntityType: EntitySet 'SyndicationLinks' is based on type 'SyndicationLink' that has no keys defined.
SyndicationContents: EntityType: EntitySet 'SyndicationContents' is based on type 'SyndicationContent' that has no keys defined.

(I have to add that before the syndication i used a simple feed reading function using the web client, but it didn't support certain xml types so i decided to switch to syndication.)

I'm brainstorming and rage searching the web for the last few hours to find some help with no success.. Already dropped the old DB and made a new one after trying to 'update-database -force' with the same results.

Thought it might be something to do with the entity framework, but it is updated to the latest version.

This is my class:

public class Feeds
{
    [Key]
    public int FeedId { get; set; }
    public SyndicationItem Feed { get; set; }

    public int SiteId { get; set; }
}

Edit: Pointing out that i obviously use code first migrations

Any help will be more than appreciated!