c# - Combine 4 parameters into something that only three arguments? -
I have some static data that I am using in C # and the first method looks like this that basically They have been declared
public class privilege profiles {string PROFILE_ID; String COMPANY_CODE; String PRIVILEGE_CODE; Public Privilege Profile (string PROFILE_ID, string COMPANY_CODE, string PRIVILEGE_CODE) {this.PROFILE_ID = PROFILE_ID; this. COMPANY_CODE = COMPANY_CODE; this. PRIVILEGE_CODE = PRIVILEGE_CODE; }}
It's all right and good, but I've got a second method with it. Add keywords and since it only takes 3 arguments, I can not add all the required static data. PRIVILEGE_CODE has several bits of data where PROFILE_ID and COMPANY_CODE have only one, do I have some bands to use or do it Do I have a format to do?
Public ServispostSpops GetPrivileges () {ServiceResponse SR = New Service Report (); & Lt; PrivilegeProfiles & gt; PrivilegeProfiles; Privileges Profile. Add new private profile ("Train Manager", "GW", ["DASER" "DAAAAP" "MRS-Upper", "MRAPS"]); RR Data Profiles = Privilege Profiles; Return SR;}
< I think that you want the PRIVILEGE_CODE field to be an array of strings instead of string. For example:Public category privileges profile {string PROFILE_ID; string COMPANY_CODE; string [] PRIVILEGE_CODE; Public privilege profile (string aPROFILE_ID, string aCOMPANY_CODE, string [] aPRIVILEGE_CODE) {this.PROFILE_ID = aPROFILE_ID; this.COMPANY_CODE = aCOMPANY_CODE; it.PRIVILEGE_CODE = aPRIVILEGE_CODE;}}
and
Comments
Post a Comment