
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 AiChapterPersonRequest : IRequest
{

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

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

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

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

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

                
}
}