Skip to main content

Posts

Showing posts with the label Web API

Web Api function in CRM 2016 C#

This is webapi C#    public class EntityRepository : Repository where T : Crmbaseentity     {         public async Task Add(T entity, string EntityName)         {             using (HttpClient client = new HttpClient(new HttpClientHandler() { Credentials = new NetworkCredential(this.UserName, this.Password, this.Domain) }))             {                 HttpResponseMessage response = await HttpClientExtensions.SendAsJsonAsync (client, HttpMethod.Post, this.CrmHost + EntityName, entity);                 if (response.IsSuccessStatusCode)                 ...