我有LINQ表達式節點類型ArrayIndex
沒有在LINQ支載到實體錯誤,當我嘗試做以下LINQ查詢裏面關於ArrayIndex
public List<AttachmentList> ShowAttachments(int type, int ReferenceId)
{
try
{
var attachmentNames =
(from attachment in tent.Attachments
where (attachment.Attachment_Type == type
&& attachment.Attachment_Reference_Pk == ReferenceId)
select new AttachmentList
{
Attachment_Pk = attachment.Attachment_Pk,
Attachment_File_Path = attachment
.Attachment_File_Path.Split(new[] {'$'})[1]
}).ToList();
return attachmentNames;
}
catch (Exception ex)
{
ExceptionHandler.ExceptionLog(ex);
return null;
}
}
正如你可以看到,我試圖分裂Attachmentfilepath
其中包含'$'
並指定第二個值([1])到Attachment_FilePath
任何人都可以請建議我怎麼可以分割並且在相同的查詢賦值給AttachmentList串 感謝
感謝nemesev編輯 – bhargav 2012-02-13 14:17:35