Get entity navigation properties after insert

前端 未结 6 808
花落未央
花落未央 2020-12-23 02:14

I have the following 2 classes:

public class Reward 
{
    public int Id { get; set; }
    public int CampaignId { get; set;
    public virtual Campaign Camp         


        
6条回答
  •  星月不相逢
    2020-12-23 02:59

    if you have more than one navigation properties or want to add more than one records it may be hard to do it in these ways.

    so i suggest if the memory doesn't matter create a new context object after adding your records , and use it instead

提交回复
热议问题