DannyRoastBeef㊙
✅ How do I abort a long running API request manually?
Hi, I'm having a bit of trouble simply cancelling a long running request on a separate ASP.Net Web API.
I've intergrated the CancellationToken into my endpoint to handle it properly when it's fired from the browser (when the back button is pressed or window is closed)
The browser magically sends this cancellation token to my endpoint if the browser is closed or something. This works great.
How I do this manually? Like if I want a button the user can press on the front-end to cancel the process on the back-end.
I've been looking at this :
https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort
but that's JavaScript of course and I'm not sure how to integrate that.
Thanks!
39 replies
(Blazor) I'm having trouble accessing a variable inside a parent component.
I'm trying to access a simple bool in a parent component that shows when my side bar has been collapsed. I'm using the Blazor Fluent UI components by the way.
Okay so I've got this FluentNavMenu:
Then I've got a parent component:
That binding sets the
SideBarExpanded
every time I open or close it. I need to access it in a parent component to hide something else. What's the best way to detect that this variable has changed in the parent?
There is also a component attribute I can add to the FluentNavMenu
called ExpandedChanged
which takes in an EventCallback
, but I have no idea how to use it in the context of this particular component.
I've watched this video around 10 times and I still can't wrap my head around it as this particular scenario seems different.
Thanks!4 replies
Using ref for large data types.
Hi, just looking for a little clarification on the ref keyword when passing data into a function.
I've hot an API endpoint which takes in files which passes them though to a function which checks them and sorts them into an appropriate destination directory.
I've got a function in another class which checks the data type is supported, among other things. Would I be right to pass the incoming multipart File data to it using a ref value to avoid making a copy of it? Some of the files can run up to 200mb in size.
Thanks for any help.
10 replies
❔ How do I get event arguments and other data into my view model when using MVVM?
I'm using the Command interface in my XAML code on a
TapGestureRecognizer
->
I'm binding it to a method in my view model which allows me to change page when I select an item from a CollectionView
->
I know i can use a query parameter in the URL to pass that through to the new page but how do I send my currently selected item from the CollectionView
in the View xaml to my View Model so I can populate the following details page with the correct information?
My current assumption is that I bind to SelectedItem
in the collection view in the view xaml but I'm not sure if this is the best approach.
Thanks!8 replies
❔ Can anyone break down this one-line code for me?
I'm following a tutorial surrounding using HttpClient properly. When adding as a service I noticed a syntax I don't think I've used before and I can't quite make sense of it. I think I understand that I'm setting the base address on the injected but how is it doing it? What is actually doing here?
The parameter is
Thanks.
11 replies