Category Archives: 16402

How to generate a property from an extension method using Roslyn

In WAQS, we have calculated properties that are generated from extension methods. In this post, we will see how we can generate a property from a method.   In my previous post, we saw a basic method to see if … Continue reading

Posted in 16402, 16868, 17895 | Leave a comment

Roslyn basis

Syntax Tree All the code could be represented as a very detailed tree. Using Roslyn, we can get this syntax tree from a document or we can use Parse methods of SyntaxFactory class. For example, you can use the following … Continue reading

Posted in 16402, 17895 | Leave a comment

WAQS: Write your code faster and better

WAQS is a code-generation solution to speed up and improve quality of.Net data centric applications development. It abstracts away the technical code in order to let developers focus on value add tasks: screens and business code. It’s great for both … Continue reading

Posted in 16402, 16868, 17697, 7674 | 2 Comments

WAQS and unit tests

7 reasons to use WAQS WAQS documentation   After writing your specifications code, it’s a good idea to test it. For this, WAQS can also help.   WAQS.Server.Mock First, we create a unit test project and we reference the server … Continue reading

Posted in 16402, 16868, 18099 | Leave a comment

WAQS: PropertyChanged

7 reasons to use WAQS WAQS documentation   PropertyChanged logic Imagine that you want to calculate OrderDetail amount and Order total. So, using WAQS, you write the following two methods in specifications to generate Amount and Total calculated properties, as … Continue reading

Posted in 16402, 16868, 18343, 18344, 8708 | Leave a comment

Interface implementation delegation

My friend Simon proposed a very interesting new feature for C# IMO yesterday for delegating interface implementation to a class field. You can download his documentation here.   And so, of course, people who know me know that I love … Continue reading

Posted in 16402, 7672 | 2 Comments

How to unit test Roslyn Rewriter?

Yesterday, I wrote a SyntaxRewriter that adds null test on method body. So it could be very easy like this one: public int Foo1(OrderDetail od) {     return od.Product.Category.CategoryID; } That becomes: public int Foo1(OrderDetail od){    if (od == null || od.Product … Continue reading

Posted in 10550, 16402, 17894, 17895, 18099 | 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

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