public static bool SavePhoneInfo(int applicantId, string phoneType, string phoneNumber, string extensionNumber, bool isActive, int userID, out string msg)
{
DataAccess dal = new DataAccess();
return dal.SavePhoneInfo(applicantId, phoneType, phoneNumber, extensionNumber,isActive, userID, out msg);
}
我想为extensionNumber参数添加一个默认值,在哪里添加参数? 在out string msg之前还是之后,c#中传递参数的顺序是什么?
在C#中,你需要把默认参数放在最后。
public static bool SavePhoneInfo(int applicantId, string phoneType, string phoneNumber, bool isActive, int userID, out string msg, string extensionNumber = "Test")
{
DataAccess dal = new DataAccess();
return dal.SavePhoneInfo(applicantId, phoneType, phoneNumber, extensionNumber,isActive, userID, out msg);
}