Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Dynamic Proxy error using class. #7298

Closed
mehmetuken opened this issue Jan 18, 2021 · 5 comments · Fixed by #7309
Closed

C# Dynamic Proxy error using class. #7298

mehmetuken opened this issue Jan 18, 2021 · 5 comments · Fixed by #7309
Assignees
Milestone

Comments

@mehmetuken
Copy link
Contributor

public class GetProductsInput : PagedAndSortedResultRequestDto
    {
        public ProductQueryFilter QueryFilter { get; set; }

        public GetProductsInput()
        {
            QueryFilter = new ProductQueryFilter();
        }
    }

My ProductsAppService get input like this c# dynamic proxy if not set any QueryFilter value request like

https://localhost:44315/api/app/product&Sorting=&SkipCount=0&MaxResultCount=10&api-version=1.0

first element starts & character. I set QueryFilter.Name = ""; empty it's run correctly.
https://localhost:44315/api/app/product?QueryFilter.Name=&Sorting=&SkipCount=0&MaxResultCount=10&api-version=1.0

i think first element issue dynamic proxy UrlBuilder.

@maliming
Copy link
Member

hi @mehmetuken

  • Your ABP Framework version.
  • Steps needed to reproduce the problem.

@maliming maliming self-assigned this Jan 18, 2021
@maliming maliming added this to the 4.3-preview milestone Jan 18, 2021
@mehmetuken
Copy link
Contributor Author

Sorry.
Abp Framework Version 4.1.1 stable

Steps,

public interface IProductAppService : ICrudAppService<
        ProductDto,
        Guid,
        GetProductsInput,
        CreateUpdateProductDto>

my ProductQueryFilter class. i use repository custom filter.

public class ProductQueryFilter
    {
        public string Sku { get; set; }

        public string Name { get; set; }
}

my input class

public class GetProductsInput : PagedAndSortedResultRequestDto
    {
        public ProductQueryFilter QueryFilter { get; set; }

        public GetProductsInput()
        {
            QueryFilter = new ProductQueryFilter();
        }
    }

i follow blazor Web Application Development Tutorial my input have class ProductQueryFilter i don't set any query filter dynamic proxy create url like this
https://localhost:44315/api/app/product&Sorting=&SkipCount=0&MaxResultCount=10&api-version=1.0 and got 404 error. Because first attribute start & character.

@maliming
Copy link
Member

Thanks I will check this.

@maliming
Copy link
Member

I can't rep[roduce it in the unit test method. Can you share a sample project?

@mehmetuken
Copy link
Contributor Author

I find i think is irrelevant but problem is any empty generic input set.

My example

public class ProductQueryFilter
    {
        public string Sku { get; set; }

        public string Name { get; set; }

        public Guid? CategoryId { get; set; }

        public IEnumerable<Guid> Attributes { get; set; }

        public ProductQueryFilter()
        {
            Attributes = new List<Guid>();
        }
    }

in here is not null but is empty generic using firstParam but not set urlbuilder because is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants