I need to implement some kind of solution such that in our business logic layer when certain conditions are met an error message is returned.
That error message should be configurable either in a file or table that can be edited at run time if needed.
I've seen it done before a few ways and it always ends up something like "This error message is {0}" and then when the dev goes the use the message they dont neccesarily know how many (if any) parameters the message needs.
Just hoping to leverage off something that may have already been done, I dont think there is a provider or anything already in the .net framework.
A solution;
Store your error messages with named placeholders like this;
Then you need a class that takes a raw error message like "this is some {size} problem" in its constructor.
The class would then allow the developer to specify values for each of the placeholders.
Finally the developer would call a method that replaces the placeholders with the specified values and returns the result.
i.e.
var rawMessage = "this is some {size} problem"; // fetch this from a file, db, or build runtime
var errorMessage = new ErrorMessage(rawMessage); // finds all the placeholders, stores them in a Dictionary<string, string>
errorMessage.SetPlaceholderValue("size", "big"); // sets the {size} placeholder value
var message = errorMessage.BuildErrorMessage(); // replaces placeholders with values and checks no values are missing
// message should look like "this is some big problem";
// this will handle any number of placeholders