Last active
April 26, 2018 04:42
-
-
Save PulkitSethi1984/a85d9dc4082f68168803c4fc328babe0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface INetworkService | |
{ | |
Task<NetResult<TResult>> GetAsync<TResult>(string uri, string token = ""); | |
Task<NetResult<TResult>> PostAsync<TResult>(string uri, TResult data, string token = "", string header = ""); | |
Task<NetResult<TResult>> PostAsync<TResult>(string uri, string data, string clientId, string clientSecret); | |
Task<NetResult<TResult>> PutAsync<TResult>(string uri, TResult data, string token = "", string header = ""); | |
Task<NetResult<bool>> PatchAsync(string uri, object data, string token = "", string header = ""); | |
Task DeleteAsync(string uri, string token = ""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetResult<T> | |
{ | |
public int ErrorCode | |
{ | |
get; | |
set; | |
} | |
public string ErrorMessage | |
{ | |
get; | |
set; | |
} | |
public bool IsError | |
{ | |
get; | |
set; | |
} | |
public T Data | |
{ | |
get; | |
set; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment