Quantcast
Channel: Gediminas Geigalas' blog » .NET
Browsing latest articles
Browse All 13 View Live

Image may be NSFW.
Clik here to view.

Bringing the IN clause from SQL to C#

Since I have to work with T-SQL (MS SQL Server SQL dialect) a lot, I tend to miss the IN clause in C# sometimes. Checking if a value is equal to a list of possible values in SQL is quite elegant: IF(1...

View Article



Image may be NSFW.
Clik here to view.

Mapping custom lists with Fluent NHibernate

NHibernate supports mapping to a few collection types by default, like IList of ISet, but they must be interfaces. To support other types of collections, including concrete classes, you should...

View Article

Image may be NSFW.
Clik here to view.

Telerik MVC Grid ActionLink column

The problem Working with Telerik MVC Grid component, I ran into an issue where I wanted to add a column with an “Open” link. Clicking that link takes you to item’s editing form. It seems, however, that...

View Article

Image may be NSFW.
Clik here to view.

Logging NHibernate queries with parameters

NHibernate lets you log the SQL statements it constructs using log4net. I’m not going to explain how to do it, because it is already well explained. It gives you flexibility on where you want to log:...

View Article

Image may be NSFW.
Clik here to view.

ASP.NET MVC localization using ActionFilter

Action filters in ASP.NET MVC provide a great way to apply custom behavior to selected controller actions. They let you execute code before or after the actual action has been executed. That reminds of...

View Article


Image may be NSFW.
Clik here to view.

Attaching to Telerik MVC Grid’s client event using jQuery

Telerik MVC Grid component offers a way to subscribe to client side events by using ClientEvents method in your views. You can see the examples here:...

View Article

Image may be NSFW.
Clik here to view.

Creating .In and .NotIn extension methods for NHibernate 3 Linq provider

In Bringing the IN clause from SQL to C# I have shown how to create extension methods for C# that mimic the “in” clause from SQL. I like these methods a lot, but they cannot be used in Linq to...

View Article

Image may be NSFW.
Clik here to view.

Testing email functionality in development environment

Many of the systems I have been working on required sending email messages as part of certain use cases: email address confirmation, notifications, system monitoring reports, etc. When working for a...

View Article


Image may be NSFW.
Clik here to view.

Autofac OnActivated for all registrations

Nowadays, I’m working with WPF using MVVM pattern. To manage NHibernate session in viewmodels, I’m using the approach shown by Ayende, where session is a property of viewmodel. The problem is simple –...

View Article


Image may be NSFW.
Clik here to view.

Moq, argument matching and Times.Never

Consider the following test code that is using Moq: private void VerifyRequestWasNotLogged() { _logRepository.Verify( r => r.LogRequest( It.Is<RequestLogData>( l => l.CurrentNumber == 0...

View Article
Browsing latest articles
Browse All 13 View Live




Latest Images