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

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

        public  SecurityUserPreferenceEntity FindByKey(SecurityUserPreferenceEntityKey key)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityUserPreferenceEntityKey,SecurityUserPreferenceEntity>("/SecurityUserPreference/FindByKey" , key)).GetAwaiter().GetResult();                }

                        public  SecurityUserPreferenceEntity[] FindBySearchCriteria(SecurityUserPreferenceSearchCriteria criteria)       
                {
return Task.Run(() =>   serviceRequest.PostAsJsonAsync<SecurityUserPreferenceSearchCriteria,SecurityUserPreferenceEntity[]>("/SecurityUserPreference/FindBySearchCriteria" , criteria)).GetAwaiter().GetResult();                }

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

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

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

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

                
}
}