I have a project that contains a stateProfile class and an Inquiry class.
The Inquiry class is static and it's job is to create a text file. The text file's contents are calculated using information stored in the properties of a stateProfile object (one for each State in the USA, that winds up being read in from an XML file).
I had been able to share a global naming schema for all of the states but I now have requirements to meet for naming them based on the stateProfile object.
For example:
I have a stateProfile for Kansas and another for Missouri.
Inquiry inquiry = new Inquiry();
foreach(stateProfile p in _listOfProfiles){
inquiry.CreateFile(p);
}
in Inquiry.CreateFile(stateProfile p) I have the expression that defines the filename:
sOutFileName = $"{p.prop1}_{p.prop2}_Literal3_{_staticProp.ToString("D4")}.txt";
Any suggestions for being able to store the logic/expression in a property like stateProfile.outFileName such as
public string outFileName {
$"{p.prop1}_{p.prop2}_Literal3_{_staticProp.ToString("D4")}.txt";
}
and then be able to refer to that property in Inquiry.CreateFile(stateProfile p) like the following?
sOutFileName = $"{p.outFileName}";