stream:// .net


Convention based Concurrency Management in Entity Framework Core

Who does not love convention over configuration? Whenever it makes sense I try to use it in my role as a system architect. It helps my programmers write more robust code out of the box. Writing con…

Wordpress on .NET Core

Peachpie is an open source project that allows for a seamless interoperability between PHP and .NET applications. In this episode, Benjamin and Jakub from th...

How to Debug Hangs Using the dotTrace Performance Profiler – .NET Tools Blog | JetBrains

This is a guest blog post from Michael Shpilt. Michael has been developing software for over 20 years. He owns the popular blog michaelscodingspot.com and recently published the book Practical Debuggi

Episode 55 - Integrating With External APIs With Alexey Golub

In this episode of the .NET Core podcast we talked with Alexey Golub about how he worked with the undocumented YouTube API to create YouTube Explode, and some of his tips for integrating with undocumented APIs.

Producer/consumer pipelines with System.Threading.Channels

Last week, I came across the following question: “Is there an async producer/consumer collection these days in .NET?”

F# 5 update for August | .NET Blog

We’re excited to announce more updates to F# 5 which will go alongside .NET 5 preview 8! We’ve shipped various updates since the beginning of this year: F# 5 preview 1 F# 5 update for .NET 5 preview 5 F# 5 update for June Today,

Should you unit-test API/MVC controllers in ASP.NET Core?

In this post I discuss unit testing of API/MVC controllers in ASP.NET Core and some of the difficulties you face.

Evaluating “ReadLine using System.IO.Pipelines” Performance in C#

Read string line by line using System.IO.Pipelines API in C#

F# for Fun and Profit · GitBook (Legacy)

fsharpforfunandprofit: Static and ebook version of fsharpforfunandprofit.com

Phillip Carter

Phillip Carter Phillip Carter ... I forked my wife's excellent site to make this one

Bring the best of the Web to your .NET desktop applications with WebView2 | .NET Blog

This blog post was written together with Palak Goel, Program Manager on Edge Product Development team. Last year at Build, we introduced WebView2, a browser control that renders web content (HTML / CSS / JavaScript) with the new Chromium-based Microsoft Edge.

Secrets of a .NET Professional

Working as a .NET Professional is a tumultuous rollercoaster ride of emotional highs and crushing lows. It’s likely the same for other communities, with different flavors of success and failures. I have over a decade of .NET development work, and I am here to share some general mantras that have served me well. I hate to call it adivce because all advice is context-specific. Readers should take any general counsel with a healthy dose of skepticism and critical thinking. That said, I hope folks reading this will find value through the prism of my experiences.

C# Switch Statement vs Expression Explained

Use of value pattern and type pattern described for both switch statement and expression (Introduced in C# 8)

ReSharper 2020.2: Improved Code Analysis for C# 8, Code Cleanup on Save, and Revamped Unit Test Runner – .NET Tools Blog | JetBrains

Hello everyone, Today we’re excited to give you ReSharper 2020.2! This major release introduces new inspections and quick-fixes for C# 8, most notably for nullable reference types, a much-awaited Code

Rider 2020.2: Localization Manager, Debugger Updates, and Major Updates to Unity Support – .NET Tools Blog | JetBrains

Rider 2020.2 is now available! To mark this great news we’ve put together a full list of the new features and under the hood improvements that are in store for you. Let’s dive in! Download Rider 2020

Best way to create an empty collection (array and list) in C# (.NET) | tabs ↹ over ␣ ␣ ␣ spaces by Jiří {x2} Činčura

Best way to create an empty collection (array and list) in C# (.NET) | tabs ↹ over ␣ ␣ ␣ spaces by Jiří {x2} Činčura Archive About tabs ↹ over ␣ ␣ ␣ spaces by Jiří {x2} Činčura Best way to create an empty collection (array and list) in C# (.NET) 4 Aug 2020 4 m

Debugging Unity Players over network and USB with Rider 2020.2 – .NET Tools Blog | JetBrains

Rider 2020.2 is a bumper release for Unity. We’ve already seen how “pausepoints” can help you debug your code, by switching the Unity editor into pause mode when your code hits a certain point. Let’s

Evolution of Pattern Matching up until C# 8.0

C# pattern matching finally brings another functional feature that will help C# developers write functional code more naturally.

dwmkerr/sharpshell

SharpShell makes it easy to create Windows Shell Extensions using the .NET Framework. - dwmkerr/sharpshell

How C# Records will change my life

The new record type will be a huge timesaver when working with immutable objects in C#.

Tales from the Evil Empire - LunrCore, a lightweight search library for .NET

I'm pretty much convinced almost all applications need search. No matter what you're building, you'll likely handle data, and no matter how well you organize it, a good text search is often the …

Using gRPC in Aurelia 2

How to use web gRPC in an Aurelia 2 SPA. Using a .NET 5 back end hosting a gRPC service. Showing compilation of protobuf files, front end build quirks and other oddities.

How to set up Microsoft Orleans’ Reporting Dashboard

Orleans is an easy to use actor framework, but how can you monitor your deployment? Luckily, there’s something simple to use — Orleans…

How To Access SQL Generated By Entity Framework Core 3

[DISPLAY_ULTIMATE_SOCIAL_ICONS] Entity Framework Core (EF) converts expressions into SQL at runtime. In earlier versions, it was straight forward to get the SQL. In Entity Framework Core 3, you must access the SQL using ILogger. This article explains how to access the SQL generated and gives some example code to access the output of queries made behind the scenes. This article works with Entity Framework Core 3. Note: Microsoft is about to release Entity Framework Core 5 soon. This version will have an easier method to get at the SQL. This is the interface method. Many developers may feel uncomfortable if they do not know what SQL EF executes behind the scenes. There's a good reason for this! Expressions may not map on to SQL very easily. You may end up executing SQL that doesn't take advantage of indexes, or the expression may end up filtering records after the data was selected from the database. In older versions of EF you could use ToTraceString()but this no longer exists in EF Core 6. There may even be other reasons to access the SQL. Perhaps your want to convert EF expressions to SQL. This is all possible in EF Core. Grab the full sample here. The Basics The key to making entity framework log SQL queries is to provide it with a logging factory: optionsBuilder.UseLoggerFactory(_loggerFactory); And, the factory must have a filter like so: var loggerFactory = LoggerFactory.Create(builder => { builder .AddFilter((category, level) => category == DbLoggerCategory.Database.Command.Name && level == LogLevel.Information); }); That's it. If you add console logging, SQL will be logged to the console when the SQL executes. var loggerFactory = LoggerFactory.Create(builder => { builder .AddConsole((options) => { }) .AddFilter((category, level) => category == DbLoggerCategory.Database.Command.Name && level == LogLevel.Information); }); This is an example query: using (var ordersDbContext = new OrdersDbContext(loggerFactory)) { var orderLines = ordersDbContext.OrderLines.Where(o => o.Id == Guid.Empty).ToList(); orderLines = ordersDbContext.OrderLines.ToList(); } This is the console output: info: Microsoft.EntityFrameworkCore.Database.Command[20101]Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30']SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND rootpage IS NOT NULL;info: Microsoft.EntityFrameworkCore.Database.Command[20101]Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']SELECT o.Id, o.Count, o.ItemFROM OrderLines AS oWHERE o.Id = '00000000-0000-0000-0000-000000000000'info: Microsoft.EntityFrameworkCore.Database.Command[20101]Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']SELECT o.Id, o.Count, o.ItemFROM OrderLines AS o Incidentally, it looks as though the where clause is not parameterized. Is this a security hole in Entity Framework Core for SQLite? Here is some further documentation on this approach. Getting More Detail You may need more detail. Or, you may want to use EF to generate SQL for some reason. You can achieve that with this code. This is an implementation of ILogger that will allow you to hook into an action when SQL runs. public class EntityFrameworkSqlLogger : ILogger { #region Fields Action<EntityFrameworkSqlLogMessage> _logMessage; #endregion #region Constructor public EntityFrameworkSqlLogger(Action<EntityFrameworkSqlLogMessage> logMessage) { _logMessage = logMessage; } #endregion #region Implementation public IDisposable BeginScope<TState>(TState state) { return default; } public bool IsEnabled(LogLevel logLevel) { return true; } public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { if (eventId.Id != 20101) { //Filter messages that aren't relevant. //There may be other types of messages that are relevant for other database platforms... return; } if (state is IReadOnlyList<KeyValuePair<string, object>> keyValuePairList) { var entityFrameworkSqlLogMessage = new EntityFrameworkSqlLogMessage ( eventId, (string)keyValuePairList.FirstOrDefault(k => k.Key == commandText).Value, ...

C# events as asynchronous streams with ReactiveX or Channels

As I am getting myself up to date with the modern C# language features, I'd like to share what feels...

Hot Vacancies

.NET Developer

American startup, .NET

A developer is needed for an American startup that manages the operation and maintenance of residential complexes. This is a new project from scratch with a temporary integration of the old system (Web Forms, no code access).

.NET Backend Developer

Field Complete, .NET

Field Complete is a team of passionate, young & fun-loving professionals looking to change the uneffective way that Servicing Industry works on US markets. Field Complete is growing really fast. We are looking for a Back End Developer to build a top-level modern API, ready for high load. Strong expertise with:

Senior Xamarin Developer

DraftKings, Mobile

You will join a mobile team which is working on two very exciting projects, Sportsbook and Casino. The apps are used by users in the US, where we are working on the regulated markets. We are releasing apps every two weeks. Our apps are generating almost 75% of the company revenue and the user base is growing daily. Technical stack on the project: Xamarin.Forms, MVVM with DI, NewRelic, Azure + App Center etc. Switching to .Net MAUI in the nearest 2-3 months.

Senior .NET Engineer

DraftKings, .NET

You will be working in a large US-oriented company that puts as a priority: security, performance, and stability. The candidate will work on pushing a huge number of changes (several thousand per sec) to several thousand clients in a near real-time manner.

Middle strong .NET developer

SoftServe, .NET

Our customer is an American company that develops software for businesses to help manage their networks, systems, and information technology infrastructure. The company provides purpose-built products for IT professionals, MSPs, and DevOps pros.