KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a requirement to extract all public read-write properties that are not enumerable, unless they are a string. This is currently done by refelction and wondering if this can be done with FastMember . I tried something like the code below but it doesn't do what I want. Can I do this with the current version of FastMember? Cheers, Berryl protected void LoadCache(IHaveEditableStateProperties originator) { var type = originator.GetType(); _accessor = TypeAccessor.Create(type); var members = _accessor.GetMembers(); _editableState = new Dictionary<string, object>(); foreach (var member in members) { if(member.Type == typeof(PropertyInfo)) { _editableState.Add(member.Name, _accessor[originator, member.Name]); } } } ... }
Tags (comma-separated)
Save Edits
Cancel