Category Archives: 7671

WAQS: Math.Round

7 reasons to use WAQS WAQS documentation   I recently had a surprise with .NET: Math.Round(3.5) = 4 (expected) but Math.Round(2.5) = 2.   Indeed, by default, Math.Round uses MidpointRounding.ToEven option.   However, SQL Round uses the AwayFromZero mode. So … Continue reading

Posted in 16868, 18204, 7671, 7672 | Leave a comment

WAQS Querying: Math methods

7 reasons to use WAQS WAQS documentation   Math calculation with LINQ To Entities As with DateTime calculation, Math methods such as Abs, Ceiling, Floor, Pow, Round and Truncate are not supported by LINQ To Entities. With L2E queries, you … Continue reading

Posted in 12253, 16868, 7671 | Leave a comment

My extreme meta-programming workshop

Today, I was in Tel Aviv speaking about meta-programming for a workshop day. As promised, I’m publishing the correction of the different exercises.   Exercise 1: The goal of the first was to change the default Edmx T4 to generate … Continue reading

Posted in 10511, 16402, 17894, 17895, 7671 | Leave a comment

FileSystemWatcher, Rx and Throttle

Imagine that we want to be notified if a directory files changed. In general, when we use files, we don’t need to have a real time application. Moreover, if we change many files in same time, we perhaps don’t need … Continue reading

Posted in 17207, 7671 | 1 Comment

How to use caching with IQueryable?

Sometimes when you use an IQueryable, you want to use a caching strategy in order to not querying your data source each time. In this post, I propose a basic implementation as a proof of concept. When you use an … Continue reading

Posted in 12253, 7671, 7672, 7674 | Leave a comment

Roslyn fluent APIs: RoslynHelper NuGet package

If you use Roslyn and you want to simplify the code rewriter, I recommend you to install my NuGet package RoslynHelper.

Posted in 16402, 7671, 7672 | Leave a comment

Use Roslyn to improve C#/VB compiler

I published a POC using Roslyn to improve C# compiler. Enjoy!

Posted in 16402, 7671, 7672 | Leave a comment

LINQ Expressions are more permissive than C#

When we use Collection initializers, we can’t write many instructions in the initialization: public class C { public int MyProperty { get; set; } } var test = new List<C>() { new C { MyProperty = { int i = 1; i … Continue reading

Posted in 7671, 7672 | 5 Comments

EF: why Include method is an anti-pattern IMHO? Part 5: many to many relationships

I recently blogged to explain why I found that Include method is an anti-pattern IMHO. EF: Why Include method is an anti-pattern IMHO? EF: Why Include method is an anti-pattern IMHO even with many to one navigation properties? 2/3 EF: … Continue reading

Posted in 7671, 7674 | 3 Comments

TechDays Paris Roslyn compiler demo

Two days ago, I spoke at Microsoft TechDays in Paris, France on Roslyn. I made several demos including one where I build my own C# compiler that allows me to add features on C#.   This compiler supports AOP in … Continue reading

Posted in 16402, 7671, 7672 | 4 Comments