Result[] GetSomethingSearch(Key searchKey) { ApiClient api = new ApiClient(); api.Credentials.UserName.UserName = "******"; api.Credentials.UserName.Password = "******"; object SomethingSearch search = new SomethingSearch(); search.Key = searchKey; result = api.GetSomething(search); }
//...Private stuff & other methods Result[] Search(Key searchKey) { //Error handling ommitted Result[] result; ApiClient api = new ApiClient(); api.Credentials.UserName.UserName = "******"; api.Credentials.UserName.Password = "******"; object SomethingSearch search = new SomethingSearch(); search.Key = searchKey; result = api.GetSomething(search); api.Close(); return(result); }