csharp

First glance at C# from JS perspective

First glance at C# from JS perspective

My journey started with… When I set out to create a project, my goal was to build a game that could potentially feature 3D elements, be interactive, and particularly played on mobile platforms. I also wanted to integrate AI into the game to add depth and complexity. Naturally, this led me to explore C#—a language commonly used in the Unity game engine. While I won’t dive into the specifics of Unity itself in this post, I do want to focus on why I chose C# and how it compares to JavaScript from my perspective as someone coming from a JavaScript…
Read More
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
Hidden NET 9 gems

Hidden NET 9 gems

Introduction When Microsoft announces a new version of the NET Framework there are release notes. The release notes do not cover all new additions and/or features. This article will introduce several new features with C# samples. Enumerable.Index<T> Enumerable.Index<T> returns an enumerable that incorporates the element's index into a tuple. Before working with Index<T>, there is the conventional route which is declaring a int variable with a value of -1 and increment the variable in a foreach. Note This is what many seasoned developers use and may very well dislike the new Index extension method as they are set in their…
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
Generics in C#: Flexibility, Reusability, and Type Safety

Generics in C#: Flexibility, Reusability, and Type Safety

Meta Description:Learn how generics in C# enhance flexibility, reusability, and type safety in your code. Explore their role in collections, algorithms, and scalable application design. 1. What Are Generics? Generics allow developers to define classes, methods, and interfaces with placeholders for the type of data they will operate on. This placeholder, called a type parameter, is replaced with a specific type at runtime or compile-time. 2. Why Are Generics Necessary? Generalized Algorithms: Some algorithms, like sorting, are independent of the type of data. For example, you can sort integers, cars, or apples as long as they are comparable. Type Safety:…
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
List all Visual Studio solutions

List all Visual Studio solutions

Introduction Learn how to get started with file globbing by creating a console project to list all Visual Studio solutions (.sln) under a specific folder along with project names for the solution exported to a json file. The reason for using solution and project files is that every reader here using Microsoft Visual Studio should have at least two while if the example were for Word documents or specific image types the code presented may not work so well. Other opportunities besides using a conventual console project there are commandline dotnet tools C# .NET Tools with System.CommandLine which the code…
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.