NHibernate - generating WHERE IN … OR … queries
2014-08-18
Let’s assume that we have a simple table GL_Task which looks like this
346 words
|
2 minutes
Resharper - localizable string literals
2014-08-17
Everyone who has ever tried to create multilingual application knows, that this is very tedious task. The most repetitive work is usually moving hard-coded strings to resource files. Fortunately with Resharper this is definitelly less painfull than usuall.
In order to point out localizable parts of application , it is necessary to decorate classes with System.ComponentModel.LocalizableAttribute.
324 words
|
2 minutes
NHhibernate - multiple queries in one roundtrip to server
2014-04-27
Usually when we need to retrieve data from database server, we write code which looks like that
501 words
|
3 minutes
Resharper - "Go to Everything"
2014-04-17
In Resharper 8 JetBrains introduced new command called Go to Everything. You can use it by hitting the CTRL + N keys (CTRL + T with Visual Studio keyboard shortcuts layout) This command is basically combination of three features known from previous versions of Resharper, namely: Go to Class, Go to Type and Go to Symbol.
Most common usage of this functionality is just to search classes, properties or functions.
113 words
|
1 minute
Resharper - annotation attributes
2014-03-02
I think one of the most important features of Resharper is on-the-fly code quality analysis.
Basically, every time Resharper finds possible pitfall in code, it indicates this with appropriate warning.
The most common warning is "Possible System.NullReferenceException".
You can easily reproduce it by writing this code
507 words
|
3 minutes
Implementing INotifyPropertyChanged without lambda expressions and "magic" strings
2014-01-19
I think almost every .NET developer is familiar with INotifyPropertyChanged interface.
Typical implementation of this interface looks more or less like that:
255 words
|
1 minute
How to check if one function calls another function
2013-12-01
An application which I’m currently developing has quite complicated authorization system.
That is why, we can not use role based authorization, and basically every developer is obliged to call appropriate security check method in every controller action he or she writes.
As You probably know it is quite easy to forget about that, therefore I decided to write a test which would check whether all controller’s action invokes this security critical function.
After hours of searching for some anchor point, I came across this article in which author creates so called “reflection based ILReader”.
ILReader is a class which allows You to iterate over IL instructions of every object of type RuntimeMethodInfo or RuntimeConstructorInfo.
One of these instructions is InlineMethodInstruction which indicates method call.
That is why, in order to get all methods which are called by given method, we have to simply select all instructions of type InlineMethodInstruction
452 words
|
2 minutes
Extjs - vertical header in grid and locked columns
2013-11-10
A while ago I wrote an article where I described how to create a plugin, which can flip header of Ext.panel.Grid vertically.
I’ve been using this plugin for a couple of months in a company I work for, however in the last week it turned out that this extension does not work for grid with locked columns.
After digging into Extjs source code I found out that when You use locked columns, the grid is created as a combination of two grids: normalGrid and lockedGrid.
Therefore it is necessary to apply vertical-header plugin to these two grids separately. In order to do that, I improved this extension to detect if grid has locked columns or not.
The main change is in init function which now looks that way
352 words
|
2 minutes