Hi I have a simple enum Service on which there are few extension methods defined
public enum Service
{
//enum values ..
}
public static class ServiceExtensions
{
internal static string GetSomeCode(this Service service)
{
// Does something
}
//another extension method that calls GetSomeCode()
internal static string GetSomeOtherData(this Service service)
{
// Look at the call for extension method here
string code = GetSomeCode(service);
}
}
I know that the syntax for calling extension method is similar as calling for member function for this specified type.
In above example it should be as -
string code = service.GetSomeCode();
I found similar use of syntax at other places in the project. I my question is there any difference between both the calls. If not then which should I prefer using ?