Finding wrapper write access through wrapped field write access Follow
I have a particular QoL thorn I think should be fixable but I'm looking for some guidance and insight.
In our current project we use a generic `Property<>` wrapper around all entries in our data layer, which basically contains this:
public class Property<T>
{
public T Value { get; set; }
/* ... */
}
and then we'd have like
public class EmployeeData
{
public Property<string> name = new();
public Property<int> age = new();
}
The crux is when you're looking at usages for eg `EmployeeData.name` you end up with all access being read access (`someEmployee.name.Value = "Alice"`) but I'm wondering if there's some way to inform ReSharper to instead classify write access to `.Value` as write access to the entire property, so we don't have to read every read access hit to see if it really is a write access to `.Value` (extra much cognitive load to differentiate `.Value = "Alice"` v `.Value == "Alice"` in results).
I wouldn't mind dig in to making a plug-in, however I got a bit overwhelmed last thing I tried so I thought I'd check with an expert first.
Cheers,
Tobias.
Please sign in to leave a comment.
Hello Tobias, thank you for your question. ReSharper doesn't have such a functionality. But creating such a plugin shouldn't be difficult - you need to add a similar component:
Please let me know if you have any questions. Thank you!