This question is locked. New answers and comments are not allowed.
There are some scenarios where I want to generate a new relationship but I already know the Id (key) of the related object and I don't want to load it to generate it.
Say we have the following:
Posts
* Id
* Title
Tags
* Id
* Name
PostTags
* PostId
* TagId
So Posts can have many tags.
2 questions then:
1) If I already know the PostId and TagId is there a way to generate that entry in the database without having to load both the Post and Tag object?
2) If not, is there a way to at least load just one? For example, loading just the Post object and do something like Post.Tags.AddByKey(tagId).
Thanks
Say we have the following:
Posts
* Id
* Title
Tags
* Id
* Name
PostTags
* PostId
* TagId
So Posts can have many tags.
2 questions then:
1) If I already know the PostId and TagId is there a way to generate that entry in the database without having to load both the Post and Tag object?
2) If not, is there a way to at least load just one? For example, loading just the Post object and do something like Post.Tags.AddByKey(tagId).
Thanks