Roundup #41: Apache Spark, Strongly Typed EntityIDs, Azure Workers, Automapper, NetCore3 Progress

Here are the things that caught my eye this week in .NET.  I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

Introducing .NET for Apache® Spark™ Preview

Today at Spark + AI summit we are excited to announce .NET for Apache Spark. Spark is a popular open source distributed processing engine for analytics over large data sets. Spark can be used for processing batches of data, real-time streams, machine learning, and ad-hoc query.

Link: https://devblogs.microsoft.com/dotnet/introducing-net-for-apache-spark/

Using strongly-typed entity IDs to avoid primitive obsession

Have you ever requested an entity from a service (web API / database / generic service) and got a 404 / not found response when you’re sure it exists? I’ve seen it quite a few times, and it sometimes comes down to requesting the entity using the wrong ID. In this post I show one way to avoid these sorts of errors by acknowledging the problem as primitive obsession, and using the C# type system to catch the errors for us.

Link: https://andrewlock.net/using-strongly-typed-entity-ids-to-avoid-primitive-obsession-part-1/

.NET Core Workers in Azure Container Instances

In .NET Core 3.0 we are introducing a new type of application template called Worker Service. This template is intended to give you a starting point for writing long running services in .NET Core. In this walkthrough you’ll learn how to use a Worker with Azure Container Registry and Azure Container Instances to get your Worker running as a microservice in the cloud.

Link: https://devblogs.microsoft.com/aspnet/dotnet-core-workers-in-azure-container-instances/

AutoMapper Usage Guidelines

A list of Do and Do Not for best practices if you’re using Automapper. I just saw that a new version was released and it made me think of this post.

Link: https://jimmybogard.com/automapper-usage-guidelines/

.NET Core 3.0 – progress on bugs, weekly update from 4/24

Link: https://twitter.com/ziki_cz/status/1121126233792585728

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Using AWS Parameter Store for .NET Core Configuration

Parameter Store for .NET Core

One of the aspects I love about .NET Core is the new configuration and options pattern. In a continuation from my last post on using AWS Parameter Store for Data Protection keys, you can imagine it is possible to use Parameter Store for .NET Core Configuration.

Amazon.Extensions.Configuration.SystemsManager

There is a package by AWS that facilitates making using Parameter Store incredibly easy. Simply add the Amazon.Extensions.Configuration.SystemsManager package to your project and use the AddSystemsManager extension method on IConfigurationBuilder

The argument you pass to AddSystemsManager will be the prefix to your configuration hierarchy within Parameter Store. In my example, I’m using /Demo as my prefix, as you will also see below.


If you look at the first two entries, I can now create classes that match this hierarchy.

Configure

Next step is to add this configuration via the IServiceCollection using the Configure<T> method. Where T is our configuration type DemoConfig

This will add registration for the type IOptions<DemoConfig> so we can inject it in our Controllers or anywhere else the ServiceProvider is used.

This results in our config variable being set to the values from Parameter Store.

Parameter Store for .NET Core

If you have any questions or comments, please let me know on twitter as I will focus my posts on those questions and comments.

Related Links:

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Roundup #40: Workers, NET 4.8, Require 4.7.2, AWS SDK, Developer Survey

Been out several weeks from posting a roundup, but it’s back!

Here are the things that caught my eye this week in .NET.  I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

.NET Core Workers as Windows Services

In .NET Core 3.0 we are introducing a new type of application template called Worker Service. This template is intended to give you a starting point for writing long running services in .NET Core. In this walkthrough we will create a worker and run it as a Windows Service.

I think this is pretty great and seems really logical. There are so many use cases and the most obvious to me is long running process for something like processing jobs off a queue.

Link: https://devblogs.microsoft.com/aspnet/net-core-workers-as-windows-services/

Announcing the .NET Framework 4.8

We are thrilled to announce the release of the .NET Framework 4.8 today. It’s included in the Windows 10 May 2019 Update. .NET Framework 4.8 is also available on Windows 7+ and Windows Server 2008 R2+.

I realize there have been many posts about .NET Framework not being “dead” because it’s built into Windows, but “dead” to me clearly means something different. There is a lot of effort being put into being able to migrate to .NET Core. The future is .NET Core. Is the .NET Framework going anywhere? No, but don’t expect much else beyond 4.8 in my opinion.

Link: https://devblogs.microsoft.com/dotnet/announcing-the-net-framework-4-8/

Require .NET Framework 4.7.2

This shows how you can author a NuGet package that will provide an error message if the consumer is on .NET Framework 4.6.1 – 4.7.1.

Unfortunately, this is needed because NuGet will allow you to install a package on 4.6.1+ when netstandard2 is really only truly supported on 4.7.2. This is an unfortunate mistake and guidance early on that caused a pile of confusion.

Link: https://github.com/terrajobst/require-net472/

AWS SDK for .NET now targets .NET Standard 2.0

As .NET Core and .NET Standard have matured since their initial release, Microsoft has been encouraging the community to set the baseline for .NET Standard libraries to be 2.0. .NET Standard 2.0 improves how dependencies are resolved. Taking a dependency on library that does not target .NET Standard 2.0 potentially caused confusing build errors or required unnecessary .NET assemblies in project deployment packages.

Link: https://aws.amazon.com/de/blogs/developer/aws-sdk-for-net-now-targets-net-standard-2-0/

Stack Overflow Developer Survey Results 2019

Stack Overflow’s annual Developer Survey is the largest and most comprehensive survey of people who code around the world. Each year, we field a survey covering everything from developers’ favorite technologies to their job preferences. This year marks the ninth year we’ve published our annual Developer Survey results, and nearly 90,000 developers took the 20-minute survey earlier this year.

Link: https://insights.stackoverflow.com/survey/2019

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.