Esempio n. 1
0
        public async Task <bool> 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 <T>(client, HttpMethod.Post, this.CRMAPI + EntityName, entity);

                if (response.IsSuccessStatusCode)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }