I have a very complicated setup of objects and each selection along the way limits or expands options available. I would hate to throw exceptions or to create invalid instance of the object. So, I want to limit options (methods available to invoke) when building an instance based on the previous method input paramters. For example if I have some rules that say if user is of type "A" then allow it to be added to roles otherwise if it is of type "B" ask for location and if location is in specific zip code ... You get the idea
Is this possible with anonymous methos, types, whatever
user type A
UserBuilder builder = new UserBuilder
builer.Build().ForType("A").WithRoles(rolesList);
user type B
UserBuilder builder = new UserBuilder
builer.Build().ForType("B").WithLocations(locationList);
Update: So basically my question is, Is there a way to limit all other public method options from the api, except for the valid ones based on the state of the object.