I'm having a hard time making this work.
The 3 classes FooType
, WebApp
& IWebApp
must not be accessbile \ visible outside of this DLL. So hence the sealed
& internal
classes.
Issues I'm having are ...
1) In WebApp
class, FeeType1
is not accessible in RouteOneBuilder
method's parameter.
2) In WebApp
class, FeeType1
is not accessible \ visible in switch's case-statement. (need to be visible).
3) In WebApp
class, CreditApplication
of FeeType1
property is not visible in the switch's case-statement (need to be visible).
Is there a better way to this complicated script? Am I already screwed for exposing classes outside of this DLL? Can all of step 1 to 4 be resolved differently (or be fixed somehow)?
I don't see how can I make this any simplier.
internal static class FooType
{
public class FeeType
{
public FeeType() { }
public string CreditApplication = "Credit Application";
public string CreditVehicle = "Credit Vehicle";
}
public FeeType FeeType1
{
get { return new FeeType(); }
private set { }
}
}
sealed class WebApp : IWebApp
{
public string RouteOneBuilder(FooType.FeeType1 typing)
{
var xml = "";
switch(typing)
{
case FooType.FeeType1.CreditApplication:
xml = "asdf";
break;
default:
throw new Exception("Unknown value");
}
return xml;
}
}
internal interface IWebApp
{
string RouteOneBuilder(FooType.FeeType typing);
}