Generate delegating members for properties?
Is it possible in ReSharper to generate the delegating members of
properties. What I am basically trying to tackle are violations on the Law
of Demeter (LoD). Here is an example:
public class Customer
{
public Address Address { get; set; }
}
public class Address
{
public string StreetName { get; }
}
What I want to do know is generate the delegating members to the Address in
Customer as follows:
public class Customer
{
public Address Address { get; set;}
public string StreetName
{
get
{
if(Address != null)
{
return Address.StreetName;
}
return null;
}
}
I thought that this was possible previously but I can't seem to find a way
to do this now?
Gabriel Lozano-Moran
Please sign in to leave a comment.
Yes. [Alt-Insert], or Edit -> Generate Code ->Delegating Members