我要做到以下幾點:如何爲LinkedItem設置一個值?
electronicSignatureModel.createdBy.Id = DbContext.CurrentUser.CreatedById;
其中electronicSignatureModel.createdBy.Id = DbContext.CurrentUser.CreatedById;很長?和DbContext.CurrentUser.CreatedById是很長的嗎?當我嘗試這樣做時,我得到一個NullReferenceException。 DbContext.CurrentUser.CreatedById有一個值,所以我認爲它與electronicSignatureModel.createdBy.Id有關。 electronicSignatureModel.createdBy是一個LinkedItem並且爲空。我怎樣才能填充這個LinkedItem,使它不爲空?
的鏈接項如下所示:
#if SCRIPTSHARP
[Imported]
[IgnoreNamespace]
[ScriptName("Object")]
#endif
public class LinkedItem : BaseModel
{
/// <summary>
/// entity that represents the item
/// </summary>
#if SCRIPTSHARP
[PreserveCase]
#endif
public string Entity;
/// <summary>
/// name of the item
/// </summary>
#if SCRIPTSHARP
[PreserveCase]
#endif
public string Name;
/// <summary>
/// id of the item
/// </summary>
#if SCRIPTSHARP
[PreserveCase]
#endif
public long? Id;
}
}
是什麼類型'electronicSignatureModel'?這種類型是怎麼樣的? – svick 2012-02-08 01:16:50