开发者

LINQ to SQL - custom propery

开发者 https://www.devze.com 2023-01-11 08:54 出处:网络
How could I add a custom prop开发者_开发百科ery to a LINQ2SQL class. if I have 2 properties \"filename\" and \"filepath\" and I\'d like to return a property such as \"fullFilePath\".

How could I add a custom prop开发者_开发百科ery to a LINQ2SQL class. if I have 2 properties "filename" and "filepath" and I'd like to return a property such as "fullFilePath".

thank!


See this MSDN article - Adding Business Logic By Using Partial Methods (LINQ to SQL)

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

精彩评论

暂无评论...
验证码 换一张
取 消