Making decisions is one of the most used tasks when writing business logic. In Visual Basic .NET you use in most cases an If .. Then .. Else statement or a Select Case statement. In C# there is no big difference, beside the fact that the naming of the keywords is a bit deviant.
Tuples are primitive types where you can easily combine multiple values to one variable. They are as a datatype not completely new for C# 7.0 or Visual Basic 15, but the way you can use them are, with the new System.ValueTuple type, is much improved. In this post I will show you how you can take advantage of the streamed syntax of value tuples.
Last night I was the ‘special guest’ on the 42th SDN Cast. I talked with fellow MVP’s Maarten van Stam en Fanie Reynders about the latest news in ‘Dev’ world, but the main topic was the future of Visual Basic .NET.
Microsoft will release Visual Studio 2017 on March 7. They organize a two-day virtual event to show the world the beauty of this latest release.
In this post I want to point you to a book which will help you to make switching between C# and VB.NET and vice versa more easily. The title of the book is actually quite self describing: ‘C#-Visual Basic Bilingual Dictionary’.
The Common Type System (CTS) ensures that components written in C# or VB.NET can interact with each other. The CTS supports two general categories of types: Value types and Reference types. Value types directly contain data. An instance of a value type is either allocated on the stack or allocated inline in a structure. These types can be natively built-in (native data types), user-defined or enumerations. A reference type, in contrast to a value type, stores a reference to the value’s…
I love Visual Basic.NET, but as a .NET developer I write code in C# too. In this serie of posts I’ll show you the main differences between VB.NET and C#. Today I will discuss the structure of classes.
One of the smartest ways to verify if two sequences of the type List(Of T) are equal, is to use LINQ. Or more specific, the extension method SequenceEqual(). It will compare both list in exact order and it returns a Boolean value, indicating if both lists are exactly the same.
Since I write on a daily base unit tests, I’m wondering more and more why there is not an easy – and especially unambiguous – way to provide a hardcoded date to a variable or procedure argument. Do you know, without any doubt, what this date actually means? Was I born on the 5th of June or the 6th of May? Visual Basic .NET will support now a good ISO-standard, which starts with the year. It follows the convention of…
When you are writing LINQ queries against an Entity Framework context, you don’t have to worry about the SQL which is generated and executed. However, in some cases you may be interested in this SQL. It’s quite easy to switch on a logging mechanism which will be display all executed SQL in your Debug window. You have to provide an Action to the DbContext.Database.Log property. You provide a lambda with the functionality you want. If you want you can log…