Is there any C# naming convention for a variable used in a property?

后端 未结 12 1685
无人及你
无人及你 2021-01-31 07:26

Let\'s say, we have a variable, which we want named Fubar

Let\'s say that Fubar is a String!

That means, we would define F

12条回答
  •  死守一世寂寞
    2021-01-31 08:28

    If there's no logic in the getter/setter, use an auto-property:

    public string Fubar {get; set;}
    

    http://msdn.microsoft.com/en-us/library/bb384054.aspx

提交回复
热议问题