Csharp - Visual Studio Code
File Edit Selection View Go Run Terminal Help
EXPLORER
src/
challenges/
achievements.json
Csharp

Language Compare Series: TUPLES in CSharp, TypeScript, and Rust

Introduction about the series I’ve been in the technology for more than a decade now, and one thing that really facinates me is when I get back to the roots of programming languages. When you just look at “coding” and not really have to deal with business requirements, what methodologies to use, and how to communicate effectively with your teams and stakeholders. This is what I particularly love about technology and programming languages, there’s always something new to learn. ...

<span title='2023-01-04 00:00:00 +0000 UTC'>January 2023</span>&nbsp;&middot;&nbsp;Michael John Peña

“CQS (Command Query Separation) in Azure Functions”

Introduction Azure Functions made it very easy to create services on the cloud. It’s very simple to get started just like Logic Apps , but also extensible like a full ASP.NET Core application (if you’re using .NET). You also have a variety of language options to choose from, so it’s not just exclusive to C# or .NET. It uses a serverless architecture so that you don’t need to maintain any runtime dependencies, operating system patches, and infrastructure maintenance as well. You then just focus on your business requirements on the behaviour that you want to create as a “function”. ...

<span title='2022-09-20 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Creating native MacOS background apps with .NET

Introduction In the previous blog post , I covered how you can create Universal Apps for MacOS. But what if you actually want to create and run a head-less (no UI) application in your Mac using your favourite .NET framework and libraries? Then I have some good news for you, it’s possible, but then again - with some caveats. For those who are already familiar with Windows Services, with .NET, you traditionally create a Windows Service project using the .NET Framework. But with introducing .NET Core you can now run .NET apps (Console and Web) on Linux and Mac without the need to use Mono . Then with it, comes the Worker Service project that allows you to create hosted services that run in the background using the IHostedService interface that allows you to run the app to any generic host - meaning no need for runtime dependencies like .NET framework. ...

<span title='2022-09-15 21:52:19 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Creating MacOS universal apps in .NET

It’s been a while since the most mind-breaking thing happened to .NET developers who are also Mac users like me - the introduction of .NET Core (of course equally excited with Xamarin and Mono as well). But with .NET core which is supported by Microsoft themselves, we can now create self-hosted applications and deploy it to almost anywhere, including Macs. This means that if you want to create an application that you want to target Macs as the host (not an app), then .NET is now a viable option. Since then .NET Core has evolved its naming into “just .NET” hence with .NET 5, .NET 6, .NET 7 - it’s just .NET that targets all platforms. ...

<span title='2022-09-13 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

Using named pipes for interprocess communication in C#

There are multiple ways applications can communicate to each other. You can use HTTP, gRPC, gRPC, web sockets, shared databases, message brokers (and buses), and the list goes on. One of the overlooked fundamentals is the use of Pipes and Streams. Pipes - a communication channel between two processes. Streams - a data collection that moves from a source to a destination. Just think of the actual ‘pipe’ where water flows. The actual pipe is the infrastructure to hold the water stream. The stream is what moves the water from point A to point B via gravity and force. In some regards, they are also considered ‘queues’ as it serves as a messaging layer between a publisher and a subscriber. They are not mutually exclusive, as streams can exist without pipes. ...

<span title='2022-09-12 00:00:00 +0000 UTC'>September 2022</span>&nbsp;&middot;&nbsp;Michael John Peña

In Memory SQLite database on C#

If you’re running a .NET application that doesn’t require a database, one of the options that you can use is having In Memory Database. What this means is that you are using the machine’s RAM to store data for your application. There are multiple ways of implementing these: Plain C# object / list / dictionary / hash table Dependency Injection with proper lifetime (singleton/trancient/scoped) Using SQLite (preferred) Why use it? If you need a temporary place to store your data. This is often used when the machine is offline. An efficient (cheap and fast) way of retrieving small data within a short lifecycle such as configurations and logs. The machine is capable enough to handle the storage size. As of right now, RAM is relatively cheap compared to latency (network) costs. When not to use it? If you need to store the data for future use. When the machine restarts, or when the application closes, all of your data will be flushed. If you need to centrally store it so that other applications can consume it. This is not meant to store large number of data set. Sample Application in SQLite One of the advantages of using SQLite is the ability to treat the data store just like a SQL database. You can perform simple T-SQL query statements and even use Entity Framework. ...

<span title='2022-08-26 00:00:00 +0000 UTC'>August 2022</span>&nbsp;&middot;&nbsp;Michael John Peña
Terminal
portfolio@datachain:~$
master
Interactive Mode
0 Problems
Ln 0, Col 1
tags
UTF-8
LF
0