I'm using EF - Database first. There is 3 table with relationship like: Topic(1)-(n)TopicAndTag(n)-(1)Tag.
- Topic: TopicId, TopicName
- Tag: TagId, TagName
- TopicAndTag: TagId, TopicId
Primary key and Foreign key has been added. Tag table contains available tags for user choose when add topic. But when new topic added, in database, I found there are new tags added in Tag table, These tag have the same name but new TagId. The relationship in TopicAndTag also has been added with new TagId unlike my available tags. How can i solve that problem.