c# - Elegantly designing a method with 2 overloads, one accepts an object the other doesn't -


I need to design a method that can potentially take an object as a parameter, if not so Method,

public zero method 1, company id, user id, client id); } Public Zero Method 1 (Special Object O, Integ Company ID) {if (o == blank) o = New Special Object (User ID, Client ID); } Expand on Daniel's answer, I have often used this method:

  Public Zero Method1 (int company id, int user id, int client id) {Method1 (new special object (User ID, Client id), Company ID); } Public Zero Method1 (SpecialObject O, int companyId) {// If necessary, (o == empty) {New logic ("O"}} ...}  
/ Html>

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -