I've created a method in C# as you can see below
public static IEnumerable<User> QueryTheAD(string filter, string identifier) {
if ( filter == "ANiceString" ) {
// sexy code here
}
}
which works well. However VS rightly shows that not all code path returns a value.
So is it therefore possible for me to specify that filter can only be one of these:
Maybe you should use an enum instead of string? :)
enum filterEnum
{
Tutor,
Year,
SecondName
}
public static IEnumerable<User> QueryTheAD(filterEnum filter, string identifier)
Enjoy ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With