There are situations when a name passed in Parameter will be Cast into a new type, but the name of the Passed object should remain similar. For the case of Class Attributes, we can use this operator, but what about for local variable in functions. What coding convention is widely used.example, void MyFunc(BaseClass myPara){  DerivedClass _mypara = (BaseClass)myPara;}or on the contraryvoid MyFunc(BaseClass _myPara){  DerivedClass mypara = (BaseClass)_myPara;}or any other conventionl
What naming Convention to Use for C# Function Parameters
c#;naming
Prefixing either parameters or local variables with an underscore is not very idiomatic in C#, it is not very easy to read and not often used (although it is legal, so you are free to so if you wish).The best name for the parameter and the variable is a descriptive name. You need to think why you are changing the type, what is the reason for the cast. Then you should be able to come up with 2 different names. E.g. is you passed a person and converted it to a customer then you could use person and / or customer in the variable names perhaps. If you really can't think of 2 different names then I would use as in the name (there was a question on this site a few days ago about this). E.g. you would use myParaAsDerived for the local variable.If at all possible I would not use this, I would think hard about the problem you are solving and what meaningful names could be used, but if all else fails this is fairly readable.