
using CloudBuilder.Core.DependencyInjection.Request;
using CloudBuilder.Core.Request;
using CloudBuilder.Core.Service;
using Microsoft.Extensions.DependencyInjection;
using CloudBuilder.AI.Service;
            using CloudBuilder.Core.DatabaseAccessor.Entity;
            using CloudBuilder.AI.Entity;
            using System;
            using CloudBuilder.AI.Data;
            using CloudBuilder.AI.SearchCriteria;
            
namespace CloudBuilder.Request.AI
{

public class AiParagraphRequest : IRequest
{

private readonly IServiceRequest serviceRequest;
public AiParagraphRequest(IServiceRequest serviceRequest)
{
this.serviceRequest = serviceRequest;
}

        public  AiParagraphEntity FindByKey(string key)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiParagraphEntity>("/AiParagraph/FindByKey?key=" + key.ToString())).GetAwaiter().GetResult();                }

                        public  AiParagraphEntity Insert(AiParagraphEntity data)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiParagraphEntity,AiParagraphEntity>("/AiParagraph/Insert" , data)).GetAwaiter().GetResult();                }

                        public void Inserts(AiParagraphEntity[] datas)       
                {
 Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiParagraphEntity[],dynamic>("/AiParagraph/Inserts" , datas)).GetAwaiter().GetResult();                }

                        public  AiParagraphEntity Update(AiParagraphEntity data)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiParagraphEntity,AiParagraphEntity>("/AiParagraph/Update" , data)).GetAwaiter().GetResult();                }

                        public void Delete(string key)       
                {
 Task.Run(() =>   serviceRequest.PostAsync("/AiParagraph/Delete?key=" + key.ToString())).GetAwaiter().GetResult();                }

                
}
}