dotnet

Building a Digital Dungeon Master with Semantic Kernel, C#, and Azure

Building a Digital Dungeon Master with Semantic Kernel, C#, and Azure

As a kid, I was fascinated by the possibilities of table top role playing games like Dungeons & Dragons, Shadowrun, and Mechwarrior, but rarely got to play them, aside from some combat encounters my brother and I set up and executed. Fast forward a few decades and I'm building software and AI solutions professionally with Leading EDJE, and one of my coworkers decided to start a RPG night. I was hooked immediately at the idea of playing a character, exploring a game world and a game master's story, and exploring the mechanics of a game system with characters and a…
Read More
Creating a Scheduled Task in Sitecore

Creating a Scheduled Task in Sitecore

Hey there, Sitecore developers! Ever wished you could automate those repetitive tasks that eat up your time? Well, you’re in luck. This short tutorial is here to show you how to create scheduled tasks in Sitecore. Whether it’s sending out reminder emails or publishing content at specific times, setting up these tasks can make your life a lot easier. Let’s dive in and see how you can get your Sitecore environment running like a well-oiled machine with minimal effort. General steps: Write the Task Code. Create a Command. Set up the Scheduler With that in mind, let's get started. 1.…
Read More
How to Build a .NET MAUI Barcode Scanner Using IronBarcode

How to Build a .NET MAUI Barcode Scanner Using IronBarcode

Barcode scanning is an essential feature in many modern applications, from retail and inventory management to ticketing systems and logistics. By automating the barcode reading process, businesses can streamline operations, reduce manual errors, and enhance efficiency. In this tutorial, we'll show you how to integrate a powerful barcode scanner into a .NET MAUI application, capturing barcodes directly from your device camera. .NET MAUI (Multi-platform App UI) is Microsoft’s cross-platform framework that allows you to build applications for iOS, Android, Windows, and macOS with a single codebase. With .NET MAUI, developing mobile applications is easier than ever, offering native access to…
Read More
Step-by-Step Guide: Write Your First Web Crawling with Selenium in C#

Step-by-Step Guide: Write Your First Web Crawling with Selenium in C#

Introduction In this exercise, we'll try to get the daily hot topics from "Google Trends". We'll walk through the WebCrawlingHelper class, which simplifies the process of navigating web pages, finding elements, and extracting data. Prerequisites Before we begin, ensure you have the following: Visual Studio or any C# IDE. .NET SDK installed. Selenium WebDriver and ChromeDriver packages installed. You can add them via NuGet Package Manager: Install-Package Selenium.WebDriver Install-Package Selenium.WebDriver.ChromeDriver Enter fullscreen mode Exit fullscreen mode Step 1: Setting Up the WebCrawlingHelper Class Create the Helper Class Create a new C# class file named WebCrawlingHelper.cs and copy the following code…
Read More
Adding Revision Support to Entities in Entity Framework Core

Adding Revision Support to Entities in Entity Framework Core

Introduction As applications evolve, the need to track historical data or version control often arises. In this article, we’ll refactor an existing entity to support revisions using Entity Framework Core, allowing us to maintain a history of changes without duplicating the data model or introducing unnecessary complexity. We’ll walk through a step-by-step approach to transition a simple Document entity into a revisioned model. This method uses a discriminator to track multiple versions of the same document, with all revisions stored in the same database table. This approach is both flexible and scalable, making it easy to apply to other entities…
Read More
Blazor’s Authorization

Blazor’s Authorization

Disclaimer: based on my observation, not readings. Recently, I had to implement Firebase authentication for a Blazor WASM project. To my surprise, I discovered there's no ready-made authentication library for Firebase on .NET. While I found the Firebase Admin library, it wasn't quite what I needed for client-side authentication. So, I ended up building my own solution for .NET. Fortunately, I didn't have to start from scratch. Firebase provides a JavaScript SDK for authentication, which is quite straightforward to use and integrates well with Blazor WASM. Blazor handles authorization through a class derived from AuthenticationStateProvider. This class requires you to…
Read More
Converting Blazor Project to WebForms Core

Converting Blazor Project to WebForms Core

WebForms Core technology helps developers manage HTML tags on the server side without the need for client-side scripting. WebForms Core is a feature in the core of the CodeBehind framework. Note: CodeBehind framework is a powerful replacement for ASP.NET Core MVC and Razor Pages and other backend frameworks.The use of WebForms Core technology also makes developers not need to use front-end frameworks such as Vue, Angular and React.However, these two are not a replacement for WebAssembly; But they are well coordinated with WebAssembly. The following project is the default version 8 of Blazor .NET Core technology, which has been rewritten…
Read More
My Experience with GitHub Copilot

My Experience with GitHub Copilot

Hello,I'm Duke and I recently dove into using GitHub Copilot, and I’ve got to say, it’s been quite an adventure! I integrated it with a couple of languages—Python and .NET—and tried it out on several popular IDEs, including VSCode, Visual Studio, Rider, and PyCharm. Here’s a rundown of what I found during my experiments. Setting It UpGetting GitHub Copilot up and running wasn’t too tricky. However, if you’re using Visual Studio, make sure you’re on version 17.10 or later (2022). It’s a little bit of a hurdle if you're on an older version, but once you get through that, you’re…
Read More
Conditional application of chained LINQ queries

Conditional application of chained LINQ queries

I write C# and I'm a big fan of using LINQ to create nice, readable chains of operations to filter and transform data in a functional style. int HighestEvenNumber(IEnumerable<int> numbers) => numbers .Where(x => x % 2 == 0) .OrderByDescending(x => x) .FirstOrDefault(); Enter fullscreen mode Exit fullscreen mode Sometimes though, there are conditions where parts of the chain should be included or omitted, but breaking the chain to add an if-statement feels wrong and disruptive. Let's say our previous example should throw an exception if there are no even numbers in the sequence instead of returning the default int…
Read More
C# advanced: Exploring Tuples An Alternative to Anonymous Types

C# advanced: Exploring Tuples An Alternative to Anonymous Types

Meta Description:Learn how to use tuples in C# for grouping elements, returning multiple values, and enhancing code readability. Explore examples, key differences from anonymous types, and hands-on assignments at easy, medium, and difficult levels Understanding Tuples in C#: A Better Way to Group Elements Welcome to a deeper dive into a powerful language feature in C#: tuples. While anonymous types are useful for grouping data, tuples offer a more flexible way to organize and access multiple values together across your application. Let's explore tuples and see how they differ from anonymous types. What Are Tuples? Tuples have been around in…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.