I have function where I want display a number in text.
if (all > 120)
{
int w_m = 120 - il_os;
string text = "free room: {0}", w_m;
ModelState.AddModelError("", text);
}
but I have a error:
Error 1 A local variable named ‘w_m’ is already defined in this scope
how display number with text in ModelState.AddModelError?
You’re missing a function there:
Placeholders in strings isn’t a language feature! Right now you’re declaring the variable
w_magain, as astring. That is a feature: