Category : asp.net-core-webapi

I’m writing an Angular app, using version 12. I opened up Angular devtools and found that I have ~150 change detection cycles each second, nonstop. It’s worth mentioning that it is an ASP.NET Core WebAPI app, which comes with ApiAuthorizationModule that adds logic and elements regarding login, logout, navigation etc. I can’t prove it definitely, ..

Read more

I have realized after posting the question that the github link below is the exact same problem, but no definite solution is given. I’m writing an Angular app, using version 12. I opened up Angular devtools and found that I have ~150 change detection cycles each second, nonstop. It’s worth mentioning that it is an ..

Read more

I have this angular file uploader which works for small files, but failed for large file with error "Access to XMLHttpRequest at ‘https://localhost:44326/api/fileUpload’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource." Did I miss anything there? ts code postFile(fileToUpload: File, dataType: string){ const formData = ..

Read more

I form data into a form for angular like this: const formDate = new FormData(); formDate.append("restaurant", JSON.stringify(this.restaurant)); formDate.append("file", this.file[0], this.file[0].name); I can see through the developer panel in the browser that the form is submitting the correct data But the controller accepts such data, and the file arrives normally Controller: [HttpPost, DisableRequestSizeLimit] public IActionResult Post([FromForm]Restaurant ..

Read more

I have a problem, I need to pass model as first a parameter, and as the second parameter, I need to pass a file Adding a file to a form: const formDate = new FormData(); formDate.append("File", this.file); Sending data from angular: this.dataService.createRestaurant(this.restaurant, formDate) .subscribe((data: Restaurant) => this.loadProducts()) Data sending service: createRestaurant(model: Restaurant, form: FormData){ const ..

Read more

For a requirement tracking anonymous user in a asp.net core – Angular project, I tried an anonymous feature referring to https://github.com/aleripe/AnonymousId. Tested by postman, the anonymousId was persistent. However, it was not when request sent from client (whether Chrome or Edge browser, didn’t try Firefox) – for every request whether refresh browser or making different ..

Read more