using CloudBuilder.Core.DependencyInjection.Request;
using CloudBuilder.Core.Request;
using CloudBuilder.Core.Service;
using Microsoft.Extensions.DependencyInjection;
using CloudBuilder.Security.Service;
            using CloudBuilder.Core.DatabaseAccessor.Entity;
            using Microsoft.AspNetCore.Http;
            using CloudBuilder.Core.Policy;
            using CloudBuilder.Core.DependencyInjection.Request;
            using CloudBuilder.Security.Data;
            using CloudBuilder.Core.Authorization;
            using CloudBuilder.Security.Entity;
            using CloudBuilder.Security.SearchCriteria;
            using CloudBuilder.Security;
            using System;
            
namespace CloudBuilder.Request.Security
{

public class SecurityMasterRequest : IRequest
{

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

        public  SecurityMasterEntity FindByKey(SecurityMasterEntityKey key)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityMasterEntityKey,SecurityMasterEntity>("/SecurityMaster/FindByKey" , key)).GetAwaiter().GetResult();                }

                        public   SecurityMasterEntity[] FindAll()
                {
return Task.Run(() => serviceRequest.GetAsync<SecurityMasterEntity[]>("/SecurityMaster/FindAll")).GetAwaiter().GetResult();                }

                        public  SecurityMasterResultData FindBySearchCriteria(SecurityMasterSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityMasterSearchCriteria,SecurityMasterResultData>("/SecurityMaster/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

                        public  dynamic PrintBySearchCriteria(SecurityMasterSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityMasterSearchCriteria,dynamic>("/SecurityMaster/PrintBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

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

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

                        public void Delete(SecurityMasterEntityKey key)       
                {
 Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityMasterEntityKey,dynamic>("/SecurityMaster/Delete" , key)).GetAwaiter().GetResult();                }

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

                
}
}