Basically, it's the simple scenario of needing to populate a dropdown with LastName, FirstName by combining the two columns in the entity to FullName. I'd like it to live in the entity so I can grab it whenever I find a use for it. Is this possible?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I would add a partial class that has the FullName property. Have a look at the designer file for your data context classes for the namespace and partial classname to use.
namespace your.namespace {
public partial class yourclassname {
public string FullName {
get { return string.format("{0} {1}", FirstName, LastName); }
}
}
}
标签:
linq-to-sql