NHibernate and the Specification Pattern
My friend Zoran Maksimovic (@zoranmax) of Agile-Code, who was the technical reviewer of my NHibernate Succinctly book (and something else too…), invited me to write a guest post at his blog. The result...
View ArticleNHibernate Pitfalls: One Shot Delete and Inverse Collections
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here.When you clear all items in an entity’s collection by calling it’s Clear() method, if it has cascading option...
View ArticleCascading Drop Down Lists in SharePoint
IntroductionA common request is the ability to have one drop down list (the child) being filled after another one (the parent) has; this is usually called cascading drop down lists.There are several...
View ArticleSimple Calculations With .NET
The idea for this post came from a recent post of Salvador Gascon (@salvadorgascon): http://salvadorgascon.wordpress.com/2014/09/27/how-evaluate-math-expressions/.For simple math expressions...
View ArticleNHibernate Pitfalls: Specifying Property Types
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here.When you want to specify an NHibernate type (implementation of NHibernate.Type.IType) for a property using...
View ArticleServiceStack Succinctly
ServiceStack Succinctly is the new addition to Syncfusion’s Succinctly series. It was written by by friend Zoran Maksimovic (@zoranmax), the main author and maintainer of Agile-Code.com.I had the...
View ArticleType Conversions in .NET
Sometimes we have an instance of some class that is not exactly the one we want. This can either be because it is not typed – is of type Object– or for some other reason. When that happens, we need to...
View ArticleNesting SPDataSource Controls
Sometimes, when you are using a SPDataSource control to bind to some list control, you might need, inside of it, to fetch information from the item you are iterating over.Imagine, for example, that you...
View ArticleLesser-Known NHibernate Features: Mapping a Class to a Query
Today I start a new series on lesser-known NHibernate features.Besides the normal mapping of a class to a table (or view, for that matter), it is also possible to map a class to a query. Do note that...
View ArticleLesser-Known NHibernate Features: Mixing Client and Server-Side Calls in...
Another not widely known feature of NHibernate: mixing client and server-side calls.To illustrate this, imagine that you want to calculate the difference between a mapped DateTime property and the...
View ArticleConditional Content in SharePoint Markup
In SharePoint, there are several web parts that allow us to have different contents depending on some conditions:LoginView (ASP.NET): allows the definition of templates per authenticated or anonymous...
View ArticleLesser-Known NHibernate Features: Entity Mode Map
This one is a real treat!When we use NHibernate or any other O/RM, we normally use classes to represent the database objects (tables or views). In NHibernate, this is called Entity Mode POCO– Plain Old...
View ArticleApplying Code Access Restrictions in .NET
Sometimes there is the need or desire to resort to Aspect-Oriented frameworks (AOP) in order to add some validations or cross-cutting concerns. In several situations, it is indeed necessary, but .NET...
View ArticleUnity - Part 7: Adding Interfaces
Another post on the Unity series, this time, adding interfaces to proxies. Previous posts here (Registration by Convention), here (Injecting Values), here (Extensions), here (Aspect-Oriented...
View ArticleLesser-Known NHibernate Features: Future Queries
Sometimes it makes sense to send several queries at the same time to the database server. This prevents multiple roundtrips and normally can provide results faster. Knowing this, NHibernate offers two...
View ArticleAdding Markup to a SharePoint Page
How many times have you had the need to add ASP.NET markup – HTML and server-side control declarations – in a SharePoint page? Yes, there is the Script Editor Web Part and the Content Editor Web Part,...
View ArticleTextBox With Suggestions in SharePoint
This control will suggest values for a text box from the values in a SharePoint list. It makes use of the HTML5 datalist element in a slightly customized TextBox control. 1:publicclass SPTextBox :...
View ArticleDisplaying Current Weather Status in SharePoint
OpenWeatherMap.org offers a nice service for obtaining current and forecast weather conditions. Go visit it, and search for the “weather in your city”. In the results page, by hovering the link, you...
View ArticleUnity - Part 8: Web
IntroductionLong overdue in the Unity series, how to use Unity in a web application. You can find the other posts here (Adding Interfaces), here (Registration by Convention), here (Injecting Values),...
View ArticleEntity Framework Pitfalls – Batch Modifications
Entity Framework does not support batch modifications, that is, UPDATEs or DELETEs of several entities at once. Neither classic nor Code First, not even Entity-SQL.For UPDATEs, you have to load each...
View Article