Here called paypal Rest API using System.Net.Http.HttpClient for OAuth 2.0 access token try { // ClientId of your Paypal app API string API ClientId = " ASCxaD7FzuvGbX-xxxxxxxx.....xxxxxxxxxxx-6RZDgwLuOyrCsy3 " ; // secret key of you Paypal app API string API Secret = " ENldyFXuW46R7Wv0 xxxxxxxx.....xxxxxxxxxxx ee8pyH8 " ; using ( var client = new System.Net.Http. HttpClient ()) { var byteArray = Encoding .UTF8.GetBytes( API ClientId + ":" + API Secret ); client.DefaultRequestHeaders.Authorization = new Headers. AuthenticationHeaderValue ( "Basic" , Conv...
Implement an Interface with Generic Methods namespace Win.Data { // Created Interface for field of table public interface IFieldTable { string Id { get ; set ; } DateTime TimeStamp { get ; set ; } string User { get ; set ; } string View { get ; set ; } string Name { get ; set ; } //string QData { get; set; } } // FieldString class inhirated from IFieldTable public class FieldString ...
Definition : Generics means allows to defining a class or method without particular any data type. It is a improve performance, productivity and type-safety. It is also said parametric polymorphism. It is most commonly use with collections like linked lists, arrays, stacks, queues, hash tables, enumerable queryable, trees etc. Perform operations such as add and delete items from the collection with regardless of the data type. Benefits : Casting is not required for accessing items from the collection Type-safe while execution Reusable code for multiple types of data Improve the performance and productivity Boxing and Unboxing are not required Where List<T> collection class is an example for generic class that can be used for add, remove and search an item of any type (T) that passed as parameter to it. Examples : class SampleClass1<T> : IDisposable { public void D...
Comments
Post a Comment