示例#1
0
        public bool HasFascicleInsertRight(FascicleType fascicleType)
        {
            string       odataFilter   = $"/FascicleService.HasInsertRight(fascicleType=VecompSoftware.DocSuiteWeb.Entity.Fascicles.FascicleType'{(int)fascicleType}')";
            IBaseAddress webApiAddress = DocSuiteContext.Current.CurrentTenant.WebApiClientConfig.Addresses.Single(x => x.AddressName.Eq(WebApiHttpClient.ODATA_ADDRESS_NAME));
            TenantEntityConfiguration fascicleEndpoint = DocSuiteContext.Current.CurrentTenant.Entities.Single(x => x.Key.Eq(ODATA_FASCICLE_ENDPOINT_NAME)).Value;

            HttpClientConfiguration customHttpConfiguration = new HttpClientConfiguration();

            customHttpConfiguration.Addresses.Add(webApiAddress);
            WebApiControllerEndpoint endpoint = new WebApiControllerEndpoint
            {
                AddressName    = webApiAddress.AddressName,
                ControllerName = fascicleEndpoint.ODATAControllerName,
                EndpointName   = ODATA_FASCICLE_ENDPOINT_NAME
            };

            customHttpConfiguration.EndPoints.Add(endpoint);

            ODataModel <bool> result = WebAPIImpersonatorFacade.ImpersonateRawRequest <Fascicle, ODataModel <bool> >(WebAPIHelper, odataFilter, customHttpConfiguration);

            return(result.Value);
        }
示例#2
0
 public static IQueryable <CategoryFascicle> GetByFascicleType(this IRepository <CategoryFascicle> repository, short idCategory, FascicleType fascicleType)
 {
     return(repository.Query(x => x.Category.EntityShortId == idCategory && x.FascicleType == fascicleType)
            .Include(i => i.Category)
            .SelectAsQueryable());
 }