2010-08-11 93 views
2

如何將自定義索引添加到LINQ2SQL類中。如果我有2個屬性「文件名」和「文件路徑」,我想返回一個屬性,如「fullFilePath」。LINQ to SQL - 自定義索引

謝謝!

回答

2

看到這個MSDN article - 將業務邏輯添加使用局部方法(LINQ到SQL)

public partial class myLinqClass { 
    public string fullFilePath { 
     get { return this.filepath + this.filename; } //clean this up as appropriate 
    } 
} 
+0

完美!謝謝! – Roman 2010-08-11 21:40:20