I am trying to create a mobile app where in I am downloading data from webserver and storing it into database.To call a server and fetch data I am using HttpClient for that I have created a class called WSServicepublic class WSService    {        private HttpClient client;        private string baseAddress = url;        private double timeout = 60 * 1000;        public HttpClient getConnection()        {            client = new HttpClient();            client.Timeout = System.TimeSpan.FromMilliseconds(timeout);            client.MaxResponseContentBufferSize = 256000;            client.BaseAddress = new Uri(baseAddress);            return client;        }        public void setBaseAddress(String uri)        {            baseAddress = uri;        }        public void setTimeout(double timeout)        {            this.timeout = timeout;        }    }and will be using this class whenever I want to make a service call to fetch data as follows in RestApi class, here I have a method to fetch customer data and later on will use it fetch company data.public async void getCustomerData()    {        try        {            WSService wsService = new WSService();            var response = await wsService.getConnection().GetAsync(new Uri(GET_CUSTOMER_DATA, UriKind.Relative));            if (response.IsSuccessStatusCode){                var content = await response.Content.ReadAsStringAsync();                Response responseData = JsonConvert.DeserializeObject<Response>(content);                if (responseData != null)                    if(responseData.status == OK)                    {                        MessagingCenter.Send<IMessage, Response>(this, GET_MASTER_DATA, responseData);                    }            }            else            {                response.EnsureSuccessStatusCode();            }        }        catch (HttpRequestException e)        {            handleError(e);        }    }In future I have to add a SFTP connections as well for file transfer so wanted to design in such a way that it emerges with WSService too.Now to hide the Creation object logic not sure which pattern I should use factory pattern or command pattern. If any one has some other ideas then do share it.
Downloading data from webserver and storing it into database
c#;design patterns;xamarin