0
代わりに使用の外国関係のために新しいレコードを挿入しますSharePointDomain)それは私が(2)でSubmitChangesは、以下に示すように、私は、有効な関係を持つ以下の表を持って割り当てられた1
にIDに私の自己を設定するときには、正常に動作します(2)//Create new Object
ReportDataSource rprtDS = new ReportDataSource
{
Name = rprtDSSelected.Name,
Parent = rprtDSSelected.Parent,
CreatedBy = Environment.UserName,
CreationDate = DateTime.Now,
Source = rprtDSSelected.Source,
Type = rprtDSSelected.Type
};
if (rprtDS.Type == "SP List")
//here is the issue
rprtDS.SharePointDomain = selectedSharePointDomain;//its id = 2
//Add to EntitySet
TheReport.ReportDataSources.Add(rprtDS);
TheReport.Save();
IDでSharePointDomainに代わりrefrenceの新しいSharePointDomainレコードinsertes
説明がありますか?
ありがとうございます。
opsそれは別のdataContextを形成しました:)、idを設定するだけで十分です。私はその動作について興味がありました。ありがとうございました。 –