Things like "MS_Description" etc.? Not AFAIK; you can write an SP that speaks to the repository in the database (with the name of the database object and the name of the column) and request it through the data context, but nothing is built in.
It would be fairly easy to write the code that uses Expressionto get the database names (instead of OO names). Sort of:
public static string GetProperty<TContext, TValue>(
this TContext ctx, Expression<Func<TContext, TValue>> selector,
string propertyName)
where TContext : DataContext
{
MemberExpression me = selector.Body as MemberExpression;
if (me == null) throw new InvalidOperationException();
var member = me.Member;
var objType = me.Expression.Type;
var metaType = ctx.Mapping.GetMetaType(objType);
string tableName = metaType.Table.TableName;
string columnName = metaType.GetDataMember(member).MappedName;
return ctx.GetProperty(tableName, columnName, propertyName);
}
(or something similar, just by running the db test ...)
GetProperty SPROC.
: , ; :
string desc = ctx.GetProperty(x => x. DataChanges.First().Change, "MS_Description");
First() - , , ; :
string desc = ctx.GetProperty(x => x.DataChanges, dc => dc.Change, "MS_Description");
, . , tableName.