You can't created "nested" extension methods, but your extension method
can return an instance of a class / struct with other methods on it.
Try something like this:
public static class MyExtensions
{
public static CustomerWrapper Customer(this SessionManager session)
{
return new CustomerWrapper(session);
}
}
public struct CustomerWrapper
{
public CustomerWrapper(SessionManager session)
{
Session = session;
}
public SessionManager Session { get; }
public ICustomerRetList QueryAll()
{
...
}
}
You'll just need to add parentheses after the
Customer
call:
SessionManager manager = new SessionManager();
return manager.Customer().QueryAll();