function - Default Parameters for method in c# -


i have following method signature want give default value 1 of parameters dont want give default value other parameter leadsourcestatus

protected promotioncatalogresponserootobject getvideopromotioncatalog(promotioncatalogtypes catalogtype = promotioncatalogtypes.residential, leadsourcestatus leadsourcestatus) 

but when try this, error

optional parameters must appear after required parameters

what best way deal this?

the best way deal told do, , put optional param @ end:

protected promotioncatalogresponserootobject getvideopromotioncatalog(leadsourcestatus leadsourcestatus, promotioncatalogtypes catalogtype = promotioncatalogtypes.residential) 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -