GetBoolString
If you need to show "Yes" or "No" depending on some bool property
Source
public static string GetBoolString(this bool value)
{
return value ? "Yes" : "No";
}
Example
string active = viewModel.IsActive.GetBoolStringFor();
ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods
If you need to show "Yes" or "No" depending on some bool property
public static string GetBoolString(this bool value)
{
return value ? "Yes" : "No";
}
string active = viewModel.IsActive.GetBoolStringFor();