I am doing some simple validation inside my controller. I keep repeating the text in quotes below:
if (!validate)
{
_MyServices.Notifier.Error
("There are some errors. Please correct them and
submit this Form again.");
return false;
}
_MyServices is just a call to an API I utilize to, amongst other things, display a notification for errors in a specific part of my view. This is just an example.
What I would like to do is keep a string somewhere so I don't have to copy this every single time and it's in one place where one change is all that is needed.
I am not good with this stuff, so how would I go about doing that in my controller? Or maybe in a separate file that multiple controller's can call to? Thanks in advance.