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

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

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

                        public  SecurityPermissionResultData FindBySearchCriteria(SecurityPermissionSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityPermissionSearchCriteria,SecurityPermissionResultData>("/SecurityPermission/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

                        public  SecurityPermissionResultData FindDependentBySearchCriteria(SecurityPermissionSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityPermissionSearchCriteria,SecurityPermissionResultData>("/SecurityPermission/FindDependentBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

                        public  SecurityPermissionResultData FindDependentsBySearchCriteria(SecurityPermissionSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityPermissionSearchCriteria,SecurityPermissionResultData>("/SecurityPermission/FindDependentsBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

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

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

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

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

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

                
}
}