Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using System.Linq.Expressions;
static class PropertyGet
/// <summary>
/// プロパティ名を取得する
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="e"></param>
/// <returns></returns>
public static string GetPropertyName<T>(Expression<Func<T>> e)
var memberEx = (MemberExpression)e.Body;
return memberEx.Member.Name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.