← Back
IAmTimCorey June 23, 2026 7m

Deleting Tickets and Wrapping Up the Ticket App - C# on Linux Episode 26

Read full transcript 6 segments
  1. It is time to wrap up the ticket app on It is time to wrap up the ticket app on Linux. In this video, we're going to add Linux. In this video, we're going to add Linux. In this video, we're going to add the final piece to our ticket page, the final piece to our ticket page, the final piece to our ticket page, allowing us to delete tickets. allowing us to delete tickets. allowing us to delete tickets. Now, this video is part of a series Now, this video is part of a series Now, this video is part of a series dedicated developing C# applications on dedicated developing C# applications on dedicated developing C# applications on Linux. Recently, we've been building a Linux. Recently, we've been building a Linux. Recently, we've been building a full app, the ticket app, that works full app, the ticket app, that works full app, the ticket app, that works through APIs and Aspire and connecting through APIs and Aspire and connecting through APIs and Aspire and connecting that to a Blazer web app front end and a that to a Blazer web app front end and a that to a Blazer web app front end and a database and all the rest to get to the database and all the rest to get to the database and all the rest to get to the point where you have a full end-to-end point where you have a full end-to-end point where you have a full end-to-end application running on Linux for us to application running on Linux for us to application running on Linux for us to play around with. So, if you haven't play around with. So, if you haven't play around with. So, if you haven't already, subscribe to this channel to already, subscribe to this channel to already, subscribe to this channel to see what comes next. Um until then, if see what comes next. Um until then, if see what comes next. Um until then, if you're looking for even more .NET SQL you're looking for even more .NET SQL you're looking for even more .NET SQL and C# training, go to imtimcorey.com. and C# training, go to imtimcorey.com. and C# training, go to imtimcorey.com. It's what funds this free content. So, It's what funds this free content. So, It's what funds this free content. So, let's jump over to Linux one more time let's jump over to Linux one more time let's jump over to Linux one more time and open up our tickets page. and open up our tickets page. and open up our tickets page. And in here, what we're going to do is And in here, what we're going to do is And in here, what we're going to do is we're going to add, let's come down here we're going to add, let's come down here we're going to add, let's come down here to our um to our um to our um we have our right down here, we have our we have our right down here, we have our we have our right down here, we have our uh form, let's uh form, let's uh form, let's bring this over. We have our edit ticket bring this over. We have our edit ticket bring this over. We have our edit ticket um for editing a specific row. What um for editing a specific row. What um for editing a specific row. What we're going to do is add one more that's we're going to do is add one more that's we're going to do is add one more that's a button for deleting tickets. So, a button for deleting tickets. So, a button for deleting tickets. So, let's do this. Um let's come down here let's do this. Um let's come down here let's do this. Um let's come down here to our code and actually write the code to our code and actually write the code to our code and actually write the code first like before and then we'll come first like before and then we'll come first like before and then we'll come back up there and put in the call to back up there and put in the call to back up there and put in the call to actually do the delete. So, private actually do the delete. So, private actually do the delete. So, private async task

  2. async task async task delete ticket async. delete ticket async. delete ticket async. We're going to pass in an ID. And in here, we're going to just have a And in here, we're going to just have a try-catch. So, we're going to say is saving equals So, we're going to say is saving equals true, font same pattern, error message true, font same pattern, error message true, font same pattern, error message equals null. equals null. equals null. And await ticket API. How How great is And await ticket API. How How great is And await ticket API. How How great is this been? Just ticket API. delete this been? Just ticket API. delete this been? Just ticket API. delete ticket async and pass in the ID. ticket async and pass in the ID. ticket async and pass in the ID. And we're done deleting tickets, right? And we're done deleting tickets, right? And we're done deleting tickets, right? So, So, So, um um um now we can do is we can now we can do is we can now we can do is we can um say await um say await um say await load tickets async. Okay. And next up we're going to do is Okay. And next up we're going to do is we're going to come down here and create we're going to come down here and create we're going to come down here and create a catch. And we'll say exception And we'll say exception ex. ex. ex. And here we'll say error message equals string interpolation failed to equals string interpolation failed to delete ticket delete ticket delete ticket and pass in ex.message and pass in ex.message and pass in ex.message to say why we failed to delete it. And to say why we failed to delete it. And to say why we failed to delete it. And then again, we're going to have this then again, we're going to have this then again, we're going to have this finally.

  3. finally. finally. Which is going to say is saving equals Which is going to say is saving equals Which is going to say is saving equals false. false. false. So, allows to to start working on that So, allows to to start working on that So, allows to to start working on that um um um that record again. Okay. So, that record again. Okay. So, that record again. Okay. So, save or I'm sorry, delete ticket async save or I'm sorry, delete ticket async save or I'm sorry, delete ticket async is now done. So, we can come up to um up is now done. So, we can come up to um up is now done. So, we can come up to um up to our form here. We can copy this to our form here. We can copy this to our form here. We can copy this because I don't want to have to retype because I don't want to have to retype because I don't want to have to retype all of this. We will take the margin end all of this. We will take the margin end all of this. We will take the margin end off. It won't be a primary button. It off. It won't be a primary button. It off. It won't be a primary button. It will be a danger will be a danger will be a danger button because this is dangerous. button because this is dangerous. button because this is dangerous. So, our on click is going to be So, our on click is going to be So, our on click is going to be delete delete delete tickets async tickets async tickets async and pass in the ticket not ticket the and pass in the ticket not ticket the and pass in the ticket not ticket the full ticket ticket.id. full ticket ticket.id. full ticket ticket.id. And we'll call this the And we'll call this the And we'll call this the delete. delete. delete. Not ed. Not ed. Not ed. Okay. So, now we have a button for Okay. So, now we have a button for Okay. So, now we have a button for deleting. Remember that delete is deleting. Remember that delete is deleting. Remember that delete is actually a real delete. We're not doing actually a real delete. We're not doing actually a real delete. We're not doing like a soft delete or something like like a soft delete or something like like a soft delete or something like that.

  4. that. that. Um Um Um but, let's but, let's but, let's run this and see it in action. And this run this and see it in action. And this run this and see it in action. And this should wrap up what we're going to do in should wrap up what we're going to do in should wrap up what we're going to do in this this this um in this application. So, um in this application. So, um in this application. So, we have done a lot here. Um let's we have done a lot here. Um let's we have done a lot here. Um let's actually run it and see it. actually run it and see it. actually run it and see it. Let's go out tickets and say, "You know Let's go out tickets and say, "You know Let's go out tickets and say, "You know what? I don't want the sample record. what? I don't want the sample record. what? I don't want the sample record. That's That seems silly." So, let's go That's That seems silly." So, let's go That's That seems silly." So, let's go ahead and hit delete. And there it goes. ahead and hit delete. And there it goes. ahead and hit delete. And there it goes. So, now they go away and come back, it's So, now they go away and come back, it's So, now they go away and come back, it's still gone. Like it's it's gone gone. Um still gone. Like it's it's gone gone. Um still gone. Like it's it's gone gone. Um you [clears throat] know, we could put a you [clears throat] know, we could put a you [clears throat] know, we could put a prompt in there that says, "Hey, are you prompt in there that says, "Hey, are you prompt in there that says, "Hey, are you sure you want to do that?" But, I think sure you want to do that?" But, I think sure you want to do that?" But, I think that's good. Um so, this kind of wraps that's good. Um so, this kind of wraps that's good. Um so, this kind of wraps up what we've been doing with the up what we've been doing with the up what we've been doing with the tickets app. Now, the point of this tickets app. Now, the point of this tickets app. Now, the point of this tickets app is just to show that you can tickets app is just to show that you can tickets app is just to show that you can develop a full .NET application using C# develop a full .NET application using C# develop a full .NET application using C# and Blazer or Android web uh prototype and Blazer or Android web uh prototype and Blazer or Android web uh prototype or um console type or there's a bunch of or um console type or there's a bunch of or um console type or there's a bunch of different prototypes you can use on different prototypes you can use on different prototypes you can use on Linux and it works just fine. It's um Linux and it works just fine. It's um Linux and it works just fine. It's um deployed just fine. We can We can now deployed just fine. We can We can now deployed just fine. We can We can now put this on GitHub or could done it put this on GitHub or could done it put this on GitHub or could done it earlier. Um and use GitHub actions to earlier. Um and use GitHub actions to earlier. Um and use GitHub actions to deploy this right to um a a web deploy this right to um a a web deploy this right to um a a web uh site of some kind or web app uh uh site of some kind or web app uh uh site of some kind or web app uh location.

  5. location. location. You know, You know, You know, the common place to deploy these types the common place to deploy these types the common place to deploy these types of applications of applications of applications is going to be Linux. So, we're already is going to be Linux. So, we're already is going to be Linux. So, we're already there. We're already testing in what there. We're already testing in what there. We're already testing in what would be a similar environment to the would be a similar environment to the would be a similar environment to the deployment environment. Um so, this is deployment environment. Um so, this is deployment environment. Um so, this is really all we needed to do to build an really all we needed to do to build an really all we needed to do to build an app. Now, I want to show this off just app. Now, I want to show this off just app. Now, I want to show this off just to show that yes, this is like to show that yes, this is like to show that yes, this is like developing on Windows. Like there's developing on Windows. Like there's developing on Windows. Like there's Yeah, there's differences. If we look Yeah, there's differences. If we look Yeah, there's differences. If we look at, you know, how VS Code works, well, at, you know, how VS Code works, well, at, you know, how VS Code works, well, it's different than how Visual Studio it's different than how Visual Studio it's different than how Visual Studio works, but this is now consistent with works, but this is now consistent with works, but this is now consistent with what we had um on Windows and on Mac. what we had um on Windows and on Mac. what we had um on Windows and on Mac. Like the VS Code experience is Like the VS Code experience is Like the VS Code experience is consistent across the the board in the consistent across the the board in the consistent across the the board in the different platforms. So, you can take different platforms. So, you can take different platforms. So, you can take this code and work on Mac, you can take this code and work on Mac, you can take this code and work on Mac, you can take this code and work on Windows, and it this code and work on Windows, and it this code and work on Windows, and it will work the same way, especially if will work the same way, especially if will work the same way, especially if you use VS Code because it's all the you use VS Code because it's all the you use VS Code because it's all the same commands, the same way, etc. same commands, the same way, etc. same commands, the same way, etc. So, So, So, Linux isn't that hard to work with. It's Linux isn't that hard to work with. It's Linux isn't that hard to work with. It's a really powerful operating system. It's a really powerful operating system. It's a really powerful operating system. It's it's different, and we've seen how to it's different, and we've seen how to it's different, and we've seen how to set things up and get things going for set things up and get things going for set things up and get things going for developers, but developers, but developers, but at the same time you can get going and at the same time you can get going and at the same time you can get going and and feel feel very comfortable building and feel feel very comfortable building and feel feel very comfortable building C# applications on Linux. The great C# applications on Linux. The great C# applications on Linux. The great thing is that Linux runs on thing is that Linux runs on thing is that Linux runs on old machine, slow machines. It runs a old machine, slow machines. It runs a old machine, slow machines. It runs a whole lot better than Windows would for whole lot better than Windows would for whole lot better than Windows would for those devices, and it can go to a lot those devices, and it can go to a lot those devices, and it can go to a lot more places. So, more places. So, more places. So, with that, with that, with that, I think that's it for the the ticket I think that's it for the the ticket I think that's it for the the ticket app. We may come I may come back at some app. We may come I may come back at some app. We may come I may come back at some point and do point and do point and do another video or two in the actual Linux

  6. another video or two in the actual Linux another video or two in the actual Linux series, but for now, series, but for now, series, but for now, thanks for watching. The source code's thanks for watching. The source code's thanks for watching. The source code's down below, and as always, I am Tim down below, and as always, I am Tim down below, and as always, I am Tim Corey.

Summary

This video focuses on completing a C# ticket application on Linux by adding ticket deletion functionality. The process involves implementing a `delete ticket async` method within the application's API, utilizing Aspire, and connecting it to a Blazer web app frontend. The practical takeaway is the successful integration of a delete feature, concluding the development of this aspect of the full-stack application.

View original episode ↗