
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;
            
namespace CloudBuilder.Request.AI
{

public class AiBookPersonRequest : IRequest
{

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

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

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

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

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

                
}
}