Creating a Web Operating System in C#

Maybe you’re wondering what a “web operating system" is? In order to explain that, we must take a look at a traditional operating system’s primary functions. The main task of an operating system is to provide a uniform way to access the underlying hardware, with the goal of simplifying the creation of applications. Hence, the "kernel" in an operating system, becomes an API which the developer can consume, to transparently access the underlying hardware of the machine. This is often referred to as "HAL," implying "Hardware Abstraction Layer."
An operating system also contains other functions – but the primary goal is to simplify the creation of apps for the end application developer, by abstracting away the "boring stuff," and making everything easier to use from an application development point of view.

Link: https://dzone.com/articles/creating-a-web-operating-system-in-c?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Using NSubstitute for Partial Mocks

I have previously written about how to, effectively, subclass using NSubstitute; in this post, I’ll cover how to partially mock out that class.
Before I get into the solution, what follows is a workaround to allow badly written or legacy code to be tested without refactoring. If you’re reading this and thinking you need this solution then my suggestion would be to refactor and use some form of dependency injection. However, for various reasons, that’s not always possible (hence this post).

Link: https://dzone.com/articles/using-nsubstitute-for-partial-mocks

Short Walks: Using AppSettings.json in ASP.NET Core

One of the things that is very different when you move to ASP.NET Core is the way that configuration files are treated. This partly comes from the drive to move things that are not configuration out of configuration files. It looks like the days of app.config and web.config are numbered and, in their place, we have AppSettings.Json. Here’s an example of what that new file might look like:
{
“Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AzureAppSettings": {
"ApplicationInsightsKey": "1827374d-1d50-428d-92a1-c65fv2d73272"
}

}
The old files were very flat and, using the configuration manager, you could simply read a setting; something like this:

Link: https://dzone.com/articles/short-walks-using-appsettingsjson-in-aspnet-core?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

.NET Core 2.0 With Angular 4 and MySQL, Part 4: Repository Pattern

With the Repository pattern, we can create an abstraction layer between the data access and the business logic layer of an application. By using it, we are promoting a more loosely coupled approach to access our data from the database. Also, the code is cleaner and easier to maintain and reuse. Data access logic is in a separate class, or sets of classes called a repository, with the responsibility of persisting the application’s business model.
Implementing the repository pattern is our topic for this post.

Link: https://dzone.com/articles/net-core-20-with-angular-4-and-mysql-part-4-reposi

Ref Returns and Ref Locals in C# 7.0

C# 7.0 introduces ref returns and ref locals. The main goal of these new features is to make it easier for developers to pass around references to value types instead of copies of their values. This is important when working with large data structures that are implemented as value types. This blog post shows how to use ref returns and ref locals in C#.
Current Ref and Out Arguments
We can use ref and out arguments to send some variables to the method and let it modify the value of this method. This way we can write methods that “return” more than one value. Ref lets the value type in by reference. Out means that the variable will get a value in the method where it is given as an argument.

Link: https://dzone.com/articles/ref-returns-and-ref-locals-in-c-70?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Create Dynamic Strings In C#

Introduction
As we all know, strings are immutable, because, after a string is stored in the memory, the memory, which is allocated for the string, cannot change.
If the string changed, a new memory location is needed to store the changed string. In these circumstances, we use the StringBuilder class with a string type.

Link: https://dzone.com/articles/how-to-create-dynamic-strings-in-c?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

The State of C# – What Have I Missed? [Video]

One of the most popular programming languages on the market is getting even better. With every iteration of C#, we get more and more features that are meant to make our lives as developers a lot easier. Support for writing (hopefully) better and more readable asynchronous code, being able to do pattern matching, tuples, deconstruction, and much more. These are just a few of the many additions to C# that we’ve seen lately. In this talk, I go through how C# has changed, as well as focusing on what’s coming in C# 7.1, 7.2, 8.0, and beyond!

Link: https://dzone.com/articles/the-state-of-c-what-have-i-missed-video?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev