C#之命名规范

2024-05-31  本文已影响0人  小羊爱学习

PascalCase:类名、枚举名、属性、常量、事件和公共方法名。

camelCase:方法参数、局部变量和私有字段(私有变量)。

注意:

public interface IStudentRepository
{
    Student GetStudentByName(string name);
}
 
public class StudentService
{
    private void OnStudentUpdated(EventArgs e)
    {
        // 事件处理器实现
    }
}
上一篇 下一篇

猜你喜欢

热点阅读