Many people neglect C# delegates because they cannot find a reason to use them. On the other hand, there is (rather small) group of people who overuse delegates in code that could be easily replaced by literal method call. So when should we use delegates? Well, they show their real power in situations when we need a mechanism to easily switch from one logic to another, without changing our application’s core code. Continue Reading
New year, new me… Just kidding, no running or yoga plans, but I decided to have a (temporary) break with ‘C# attributes you should know’ series and start with a brand new one – C# facts that somehow surprised me. For the first article, I will show you how (friendly looking, always helpful, good guy) enum can become an asshole. An asshole who will steal your precious time!
Today I again focus on the attributes that will make your debugging less painfull :). This time my scribbles should appeal to the programmers who prefer keeping their code clean (and adhere to the principle: the less ‘spare’ code the better).
So grab a mug of whatever you like and take a look at DebbugerBrowsable and DebuggerDisplay . The first one may be a good alternative to DebuggerTypeProxy I described in previous post and the second one is just ‘a must’ (really!) that makes life easier. Continue Reading
Last time I wrote about C# attribute DebuggerTypeProxy that helps us customize the way we display our type’s data while debugging. Today I would like to introduce you to the world of attributes that helps you skip some parts of code while debugging. Most of the C# programmers probably know them well, but I realized that only a few can tell the differences between them. So, ladies and gentlemen, let me introduce you the DebuggerStepThrough and DebuggerHidden. Continue Reading
[DebuggerTypeProxy] is very useful attribute when you have a class that inherits from another class and that one inherits from another one, and some of the classes contain collections of items and hundreds of properties that in fact are not important to you… Strictly speaking, when displaying class’ members while debugging makes you feel like quitting the job. Continue Reading
C# Attributes are very popular for ‘decorating’ assembly with some additional data, usually influencing on the application’s behavior or the way data are managed. You probably already used at least some of them – Obsolete, Serializable, Required, Display, MaxLength, RegularExpression, WebMethod are only a few of hundreds available in .Net world. What is more, you can write your own custom attribute and use it like a build-in one. I will write more about this in the next post. Right now, let’s focus on… Continue Reading
In the last post I wrote about one of the .Net Core 2.0 features – Razor Pages. Today, we will crawl a little bit in this mud… I mean, we will write some code.
I chose a simple BMI calculator as a demo project (you can download the code from github). You know, 2 inputs and the code-behind that will tell us if we are very fat or just slightly fat or we are OK and it’s time for another cookie. Because, there is always a time for a cookie, no matter what! Continue Reading
Last week I mentioned that with .Net Core 2.0 we got something that makes my jaw drop. This “little” feature that made me feel slightly uncomfortable is Razor Pages. In this post, I will show you what it really is or, in fact, what it is not 😊 and if we should be afraid of it. Continue Reading
This is the third article in the series of the last Microsoft releases and this time I will focus on Visual Studio update – labeled ‘15.3’. I am usually easily pleased with most of the Microsoft IDE features so forgive me all of my ‘ohhh’ but I really love all this changes 😉.
At Monday, we had a highly anticipated release – .Net Core 2.0 ! If it is not enough, we also got a new version of Visual Studio 2017 – update 15.3 (and I will write about it in the nearest feature). So now, I will try to show you the most interesting features of the youngest .Net kid. Continue Reading