Update XSD Designer.cs to get specific data in UPPER case

89 Views Asked by At

How can I enforce in the XSD file to get any string variable always in UPPER case at code level?

To implement this I've done changes in the designer.cs file in the get property of the variable because this variable is used at number of places in the application and wanted to do minimal changes. As far I know this is not a right place to done changes.

Earlier Code:

public string UserCode { get; set; }

Modified code:

private string usercode;

public string UserCode 
        {
            get
            {
                usercode.ToUpperInvariant();
            }
            set { usercode = value; }
        }

Could anyone have any idea how can we do this without changing designer.cs file?

1

There are 1 best solutions below

3
On

Try that:

class Program.cs

private UserCode m_UserCode;
public UserCode userCode { get { return m_SpUniqueId; } }

And than in your desired function you could do:

m_UserCode = userCode.ToUpperInvatiant();

Note, I have not tested it but I think this should do your work.