.Net 6 : PeriodTimer

.NET supports various timer classes, each of which offers different functionality. As Microsoft states in its documentation, System.Timers.Timer, which fires an event and executes the code in one or more event sinks at regular intervals. The class is intended for use as a server-based or service component in a multithreaded environment; it has no user … Continue reading .Net 6 : PeriodTimer

Caliburn Micro 4.0 – Issue with EventAggregator

I have always like Caliburn Micro since I started using few years back. Of course had the opportunity to use it at work as well and that made it more likeable. But at the same time, I am not a huge fan of one of the latest changes that happened in v4.0, even though I … Continue reading Caliburn Micro 4.0 – Issue with EventAggregator

.Net 6 : ArgumentNullException.ThrowIfNull

.Net 6 has some nice little hidden features which helps in creating cleaner code, and in this post we will look into one such feature. Previously, if we needed to check if an object is null and raise an exception, we would have done as the following. void Foo(Bar bar) { if (bar is null) … Continue reading .Net 6 : ArgumentNullException.ThrowIfNull

Source Generator for DebuggerDisplayAttribute

While Debugging your application, it is often handy to have the DebuggerDisplayAttribute set, enabling you to quickly glance over complex data structures. While these aren't way too much to type in your self, it would be handy to have the code Auto generated for you. In this blog post, we will create a Source Generator using the … Continue reading Source Generator for DebuggerDisplayAttribute

WPF Tips and Tricks 001: TargetNullValue and FallBackValue

In this series of WPF Tips and Tricks we will cover smaller but useful WPF features which would help in making our applications better. n this first part of WPF Tricks,we will examine two often ignored and less frequently properties of Binding class - TargetNullValue and FallBackValue. TargetNullValue Consider the following View and ViewModel. View … Continue reading WPF Tips and Tricks 001: TargetNullValue and FallBackValue

Json To Xml : Wrapping the Array Elements

In this post, we will look into a scenario when you need to convert a Json to XML, but at the same time need to add a wrapping Property for each array. For example, consider the following Json { reportId : 23232, submittedBy : 'Anu Viswan', projects:[ { id:1001, name:'Project 1', }, { id:1002, name:'Project … Continue reading Json To Xml : Wrapping the Array Elements

Single View for Multiple ViewModels in Caliburn Micro

One of the recent questions I saw in Stackoverflow involved a scenario wherein, the developer had to reuse the same View for different ViewModels. In his case, the ViewModels where subtypes of same BaseViewModel and hence it made sense to reuse the View. For example, Consider the following public class TempatureViewModel:VariableViewModel{} public class PressureViewModel:VariableViewModel{} public class HumidityViewModel:VariableViewModel{} … Continue reading Single View for Multiple ViewModels in Caliburn Micro

Rosyln API Recipies Part 001

This blog post focuses on featuring couple of reusuable methods which one could find useful when working on Code Analyzer/CodeFix or Source Generators. HasAttribute Quite often one needs to check if the member declaration like Class, Property, Enum declaration has a particular attribute. The following method helps in detecting the same. public static bool HasAttribute<TAttribute>(this … Continue reading Rosyln API Recipies Part 001

Google Authentication for your Azure Function app

In this blog post, we will focus on Authenticating Azure Functions using Google Authentication. We will be using App Service to use Google as our Identity Provider. Let us begin by creating our sample Azure Function and deploy it to Azure. We will ensure that the Authentication Level is set to Anonymous for our sample … Continue reading Google Authentication for your Azure Function app

The Last Non-Null Value Problem

I recently came across a problem with a query in Sql Server which I thought about sharing in my blog as this could be useful to many. Following is a summary of the problem. A similar problem is discussed in the Blog Entry¬†First Non Null Puzzle¬†by Itzik Ben-Gan. But my own problem had a little … Continue reading The Last Non-Null Value Problem