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

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

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

                        public  AiSentenceViewEntity[] FindByChapterGuid(string chapterGuid)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiSentenceViewEntity[]>("/AiSentence/FindByChapterGuid?chapterGuid=" + chapterGuid.ToString())).GetAwaiter().GetResult();                }

                        public  AiSentenceViewResultData FindBySearchCriteria(AiSentenceSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<AiSentenceSearchCriteria,AiSentenceViewResultData>("/AiSentence/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

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

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

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

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

                
}
}