Worker Services in .NET Core 3

Note to myself – Excellent article on the worker services in .NET Core 3:

Introduction to Worker Services in .NET Core 3.0

Advertisements

It’s here! Trackable Entities for EF Core!

Tony Sneed's Blog

The idea behind my open source Trackable Entities project is quite simple: track changes to an object graph as you update, add and remove items, then send those changes to a back end service where they can be saved in a single transaction.  It’s an important thing to be able to do, because it’s difficult to wrap multiple round trips in a single transaction without holding locks for a long time.  On the other hand, you could break up related operations into multiple transactions, but then you lose the benefit of atomicity, which enables you to roll back all the changes in a transaction should one of them fail.

To get started with Trackable Entities for Entity Framework Core, download the NuGet package and check out the project repository.  You can also clone the sample applications and follow the instructions.

View original post 1,320 more words

Does the usage of Thread.Sleep(…) warrant making the method Async in an API

Say you are developing an API where you have to use Thread.Sleep(…) since you are working with some device via a COM and you need to wait for the predefined amount of time before you can read from the device and there is no way around it. For example:

Rule in designing APIs in my head, is that you shouldn’t make something Async unless the underlying API(s) you are working with is also Async or uses BeginX EndX, continuations, i.e. something that is already asynchronous. By prematurely making something Async you are making an implementation decision for the consumer of the code. The code provided above doesn’t expose any such API.

Continue reading “Does the usage of Thread.Sleep(…) warrant making the method Async in an API”

ReSharper: Using [NotNull] to generate better code

If you’re a ReSharper user I think this can be very usefull technique in identifying bugs in your code from the very early stage

Christian Harlass's Blog

My all-time-favorite VS plugin, ReSharper, has amongst all the features one which gets hardly noticed: The Annotation Framework and it’s influence on code generation.

The Annotation Framework is a set of “hints” which can be applied to your code, either directly in form of Attributes or stored as an an external XML file (the ReSharper team was using the later method to enhance the .Net Framework libraries). The attributes, which I usually use, are NotNull and CanBeNull. There are some more but those two give you the greatest benefit.

To use them, add at first a reference to theJetBrains.Annotations.dll to your project. It can be found in the ReSharper installation folder (better add a copy to your project and SCM though).Then you can already start annotating your code, such as:

Pretty self-explaing, isn’t it? When trying to assign then null to the person’s name, ReSharper will give…

View original post 86 more words

Phantom 4 Advanced

Drone Users Anonymous - Feeding the drone addiction

Just two days ago I bought myself Phantom 4 Advanced. I debated within myself whether I needed all the features of Phantom 4 Pro and decided that the extra pair of anti collision sensors plus the ability to use 5.8Ghz spectrum wasn’t worth it. I noticed in all the screenshot from Phantom 4 Pro that everyone still uses 2.4GHz. 5.8GHz is designed to be used in built up areas. Due to the fact that the whole area where I live use the same ISP, which provides 5.8Ghz routers as standard it wouldn’t have helped me. Out in the open you would still want to use 2.4GHz as it provides a superior range. In the end the deciding factor was the deal that I managed to get on eBay – I got a brand new Phantom 4 Advanced for a mere £700. How and why would someone want to sell a…

View original post 624 more words

Blog at WordPress.com.

Up ↑