ViIvanov

Do not hardcode names

Aug 15th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.15 KB | None | 0 0
  1. private struct S { }
  2. private static readonly string ValuePropertyName = Array.Find(typeof(S?).GetProperties(), item => item.PropertyType == typeof(S)).Name;
Advertisement
Add Comment
Please, Sign In to add comment