<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://darioquintana.com.ar/blogging/wp-atom.php">
	<title type="text">Dario Quintana</title>
	<subtitle type="text">at blogging</subtitle>

	<updated>2011-04-18T04:31:55Z</updated>

	<link rel="alternate" type="text/html" href="http://darioquintana.com.ar/blogging" />
	<id>http://darioquintana.com.ar/blogging/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.2">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DarioQuintana" /><feedburner:info uri="darioquintana" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.3.1 GA]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/yOLw0riJu2Q/" />
		<id>http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/</id>
		<updated>2011-04-18T04:31:55Z</updated>
		<published>2011-04-18T04:31:55Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Uncategorized" />		<summary type="html"><![CDATA[Hello friends, here is the new release of NHibernate Validator. There are 2 improvements in this release since NHibernate 1.3.0 GA, call it a service pack . First of all, Log4net is not longer needed as a dependency. What this &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/">&lt;p&gt;Hello friends, here is the new release of NHibernate Validator. There are 2 improvements in this release since NHibernate 1.3.0 GA, call it a service pack &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Guiño" src="http://darioquintana.com.ar/blogging/wp-content/uploads/wlEmoticon-winkingsmile.png" /&gt;.&lt;/p&gt;
&lt;p&gt;First of all, &lt;strong&gt;Log4net is not longer needed as a dependency&lt;/strong&gt;. What this means: tecnically the NHibernate.Validator.dll doesn’t need the library log4net.dll. If you have Log4net in your project NHibernate Validator will detect it and will use it. How cool is that?. This was achieve it easily, using a NHibernate feature: NHibernate.IInternalLogger.&lt;/p&gt;
&lt;p&gt;This later improvement has to be with the second feature: &lt;strong&gt;support for NuGet&lt;/strong&gt;. Yes, now you can install NHibernate Validator into your project using &lt;a href="http://nuget.org/"&gt;NuGet&lt;/a&gt; with just one command into the console.&lt;/p&gt;
&lt;p&gt;Here is the page for the nuget package for NHibernate Validator: &lt;a href="http://nuget.org/List/Packages/NHibernate.Validator"&gt;Go here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb.png" width="620" height="492" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Where to get NHibernate Validator 1.3.1 GA ?&lt;/p&gt;
&lt;p&gt;Download binaries and source from Sourceforge&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sourceforge.net/projects/nhcontrib/files/NHibernate.Validator/1.3.1%20GA/?"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image1.png" width="325" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download binaries with NuGet&lt;/p&gt;
&lt;p&gt;&lt;a href="http://darioquintana.com.ar/blogging/wp-content/uploads/image2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://darioquintana.com.ar/blogging/wp-content/uploads/image_thumb1.png" width="620" height="85" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtXU789le6jWKbOaSbWN75tfvco/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/yOLw0riJu2Q" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2011/04/18/nhibernate-validator-1-3-1-ga/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.2 Beta3 released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/6iTqfLSvCZU/" />
		<id>http://darioquintana.com.ar/blogging/?p=88</id>
		<updated>2009-10-26T16:24:08Z</updated>
		<published>2009-10-26T16:24:08Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Contrib" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate Validator" />		<summary type="html"><![CDATA[Download NHibernate Validator 1.2 beta3 with sources, binaries and example here here For use it with NHibernate 2.1 GA. For examples and documentation see the serie of blog posts of Fabio Maulo about NHibernate Validator here]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Download NHibernate Validator 1.2 beta3 with sources, binaries and example here &lt;a href="https://sourceforge.net/projects/nhcontrib/files"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For use it with NHibernate 2.1 GA.&lt;/p&gt;
&lt;p&gt;For examples and documentation see the serie of blog posts of Fabio Maulo about NHibernate Validator &lt;a href="http://fabiomaulo.blogspot.com/search/label/Validator"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TKV4tK_l_LkP0RLwNKjDdf2sUKY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/6iTqfLSvCZU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/10/26/nhibernate-validator-1-2-beta3-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.2 Beta2 released]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/rhsmBaEXjJI/" />
		<id>http://darioquintana.com.ar/blogging/?p=85</id>
		<updated>2009-10-10T18:13:05Z</updated>
		<published>2009-10-10T18:13:05Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate Validator" />		<summary type="html"><![CDATA[Download NHibernate Validator 1.2 beta2 with sources, binaries and example here here For use it with NHibernate 2.1 GA. Enjoy it !]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Download NHibernate Validator 1.2 beta2 with sources, binaries and example here &lt;a href="https://sourceforge.net/projects/nhcontrib/files"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For use it with NHibernate 2.1 GA.&lt;/p&gt;
&lt;p&gt;Enjoy it !&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dTYIMNLHY6H1X1mjorMQ40tUQy8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/rhsmBaEXjJI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/10/10/nhibernate-validator-1-2-beta2-released/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[jqGrid + Linq + Asp.Net MVC example]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/dPvtS9P5DEE/" />
		<id>http://darioquintana.com.ar/blogging/?p=76</id>
		<updated>2009-08-15T18:20:07Z</updated>
		<published>2009-08-15T18:20:07Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net" /><category scheme="http://darioquintana.com.ar/blogging" term="jqGrid" /><category scheme="http://darioquintana.com.ar/blogging" term="jQuery" /><category scheme="http://darioquintana.com.ar/blogging" term="Linq" />		<summary type="html"><![CDATA[For those who want get working these tools/frameworks and achieve a grid like this: Okey, if you like that, this is the stuff used to get it work: System.Linq.Dynamic. More&#8230; jqGrid. More&#8230; and for more Online Demos go here&#8230; Asp.Net &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/">&lt;p&gt;For those who want get working these tools/frameworks and achieve a grid like this:&lt;/p&gt;
&lt;p&gt;&lt;img class="aligncenter size-full wp-image-81" title="jqGridMVCExample" src="http://darioquintana.com.ar/blogging/wp-content/uploads/jqGridMVCExample.png" alt="jqGridMVCExample" width="523" height="499" /&gt;&lt;/p&gt;
&lt;p&gt;Okey, if you like that, this is the stuff used to get it work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;System.Linq.Dynamic. &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx"&gt;More&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;jqGrid. &lt;a href="http://www.trirand.com/blog/"&gt;More&amp;#8230;&lt;/a&gt; and for more Online Demos go &lt;a href="http://www.trirand.com/jqgrid/jqgrid.html"&gt;here&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Asp.Net MVC. &lt;a href="http://www.asp.net/mvc/"&gt;More&amp;#8230;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://darioquintana.googlecode.com/files/jqGridMVC.Example.zip"&gt;Download the code example here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The application was based on the well known example from &lt;a href="http://www.haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx"&gt;haacked.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_4C2llYazx2EEbyToERHR7ByzC8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/dPvtS9P5DEE" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/08/15/jqgrid-linq-asp-net-mvc-example/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[Asp.net MVC: Testing a custom Authorize filters]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/FQ0aFzYniAc/" />
		<id>http://darioquintana.com.ar/blogging/?p=69</id>
		<updated>2009-05-23T23:42:35Z</updated>
		<published>2009-05-23T23:39:19Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="Testing" /><category scheme="http://darioquintana.com.ar/blogging" term="Web" />		<summary type="html"><![CDATA[Asp.net MVC let you intercept the actions via a feature they call: Filters. Filters are just attributes that you decorate into actions and them allow to you make an stop before or after the action-methods are executed (also are filters &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/">&lt;p&gt;Asp.net MVC let you intercept the actions via a feature they call: Filters. Filters are just &lt;a href="http://msdn.microsoft.com/en-us/library/system.attribute.aspx"&gt;attributes&lt;/a&gt; that you decorate into actions and them allow to you make an stop before or after the action-methods are executed (also are filters to intercept code before/after the result is executed, errors are thrown, etc). There are a few kind of Filter attributes, in the picture bellow into the blue square you&amp;#8217;ve what filters came supported out-of-the-box.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters01.png" /&gt;&lt;/p&gt;
&lt;p&gt;Today we are going to talk about the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute.aspx"&gt;AuthorizeAttribute&lt;/a&gt; and how to extend and test it. &lt;/p&gt;
&lt;p&gt;AuthorizeAttribute (from the Msdn):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Represents an attribute that is used to restrict access by callers to an action method.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This filter is the first to be called when the Controller Action Invoker try to run Action methods. You can set into the attribute which are the Users or Roles can execute an Action, if the User/Role doesn?t fulfill with what was established into the Action an &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.httpunauthorizedresult.aspx"&gt;Unauthorized Result&lt;/a&gt; is raised. Remember that exactly after the filter execution ended in a &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx"&gt;ActionResult&lt;/a&gt;, that result is executed.&lt;/p&gt;
&lt;p&gt;Now, let?s go to the hypothetical scenario that you need a custom authorization schema, that you need more than User/Role, or you just need neither of both, because your model is based on a Security &lt;strong&gt;Level&lt;/strong&gt;. So you don?t care about who is the guy? / or what role it has?, you just need the security level it has.&lt;/p&gt;
&lt;p&gt;With this scenario you can write a custom Authorize attribute:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters02.png" /&gt; &lt;/p&gt;
&lt;p&gt;In this &lt;em&gt;CustomAuthorize&lt;/em&gt; attribute, we are doing first the well known authorization (which is, executing the code as is in the class base). When that authorization part passed, we go through our custom authorization part: we get the user from the Database (or whatever other source) and we check the security level. If it?s allowed to execute the action-method we end without setting the result. If it?s not, we set a &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.httpunauthorizedresult.aspx"&gt;HttpUnauthorizedResult&lt;/a&gt;. In the browser you will be redirected to the login page if you?re not allowed to execute that code.&lt;/p&gt;
&lt;p&gt;Now the problem is when you need to test the authorization. Actually you can do it with some mock and overriding some code.&lt;/p&gt;
&lt;p&gt;Another thing you?ve to know is that the object in charge of execute the actions is the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.controlleractioninvoker.aspx"&gt;ControllerActionInvoker&lt;/a&gt;. Then to invoke and action into your tests and see the result when the filters are invoked, we need to customize some, and override the method in charge of execute the result (the ActionResult), which is InvokeActionResult. Where is how should looks our method override:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters03.png" /&gt; &lt;/p&gt;
&lt;p&gt;Assert is a class from a Unit Testing framework, in this case in the example is using the Unit Testing framework that came with Visual Studio because every user can run the tests without have ie: Resharper installed. This Assert is expecting that the Result from the filter/action execution is the same with the TResult (is a generic parameter declared into the class). So with this class, we can make an easy test to see if the result is authorized or unauthorized.&lt;/p&gt;
&lt;p&gt;Our test for authorized access, should be looking like this&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters04.png" /&gt; &lt;/p&gt;
&lt;p&gt;First we are creating a new Controller, we mock stuff for authentication, and then using our custom action invoker to try to invoke the action using InvokeAction method (passing the Context and the Action name to be executed).&lt;/p&gt;
&lt;p&gt;We are using some extensions and helpers methods, i.e.: &lt;em&gt;SetFakeAuthenticatedContext&lt;/em&gt; is included into the example and there you?ll see which elements you need to mock when use Authorize filter-attributes.&lt;/p&gt;
&lt;p&gt;To understand what happened in this first test method:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Controller creation &lt;/li&gt;
&lt;li&gt;Mock authentication stuff using our user named:?pepe?. &lt;/li&gt;
&lt;li&gt;Using the custom invoker we launch the action ?PermisiveAction?. &lt;/li&gt;
&lt;li&gt;The CustomAuthorized filter is raised, it pass the authorization. &lt;/li&gt;
&lt;li&gt;The action is executed and return a ViewResult (doing return View() into the code). &lt;/li&gt;
&lt;li&gt;The Assertion is made, everything ok and the test pass. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And now let?s see this another test&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/Mvc-filters05.png" /&gt; &lt;/p&gt;
&lt;p&gt;The difference with the previous one is in the step 4, 5 and 6. The action is not executed because the filter raise an HttpUnauthorizedResult. Download the example to understand better how to manage the testing of Authorization on Actions.&lt;/p&gt;
&lt;h2&gt;&lt;a href="http://darioquintana.googlecode.com/files/MvcAuthorize.zip"&gt;Download code example&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_myANfSWZZcqcgJ7sEaVt02Dt4E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/FQ0aFzYniAc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/05/23/aspnet-mvc-testing-a-custom-authorize-filters/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator Quickstart]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/ZwqGt5FTOnY/" />
		<id>http://darioquintana.com.ar/blogging/?p=68</id>
		<updated>2009-05-18T04:51:28Z</updated>
		<published>2009-05-18T04:51:28Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" /><category scheme="http://darioquintana.com.ar/blogging" term="Quickstart" /><category scheme="http://darioquintana.com.ar/blogging" term="Web" />		<summary type="html"><![CDATA[The NHibernate Validator Team had prepared examples to you be able to use this validation framework in a easy way. With four examples we are covering the following topics: 1) Winforms In this example you will how you can easily &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The NHibernate Validator Team had prepared examples to you be able to use this validation framework in a easy way. With four examples we are covering the following topics:&lt;/p&gt;
&lt;h3&gt;1) Winforms&lt;/h3&gt;
&lt;p&gt;In this example you will how you can easily integrate NHibernate Validator and some helper clases with System.Windows.Forms.&lt;/p&gt;
&lt;h3&gt;2) NHibernate Integration&lt;/h3&gt;
&lt;p&gt;Trying to integrate NHibernate Validator with NHibernate? Not a problem. In this example you will how really get these 2 great frameworks working together. NHibernate Validator let you intercept Saves and Updates from NHibernate validating your entities before these changes take place. Note you have to create a database based on the configured connection string.&lt;/p&gt;
&lt;h3&gt;3) Asp.Net MVC&lt;/h3&gt;
&lt;p&gt;Asp.Net MVC has a cool way to add validation errors from model and display them all into the View. This example cover the easy integration between these frameworks. Note, you need Asp.Net MVC installed into your machine.&lt;a title="Download Asp.net MVC" href="http://www.asp.net/mvc/"&gt;Download Asp.net MVC&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;4) Entity Validator&lt;/h3&gt;
&lt;p&gt;Sometimes you need to validate a property which depends of another(s) property(ies). The most common example is when you have to validate a range of dates. This example cover this funcionality and show to us how to configurate it using attributes, xml and fluent.&lt;/p&gt;
&lt;h2&gt;&lt;a href="https://sourceforge.net/project/showfiles.php?group_id=216446&amp;amp;package_id=275108"&gt;Download it here&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BShANMwYkVoTjktk2GvRV7BMhfY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/ZwqGt5FTOnY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/05/18/nhibernate-validator-quickstart/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator and Asp.Net MVC]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/Q2zr6f4qGxA/" />
		<id>http://darioquintana.com.ar/blogging/?p=65</id>
		<updated>2009-04-03T11:09:42Z</updated>
		<published>2009-04-03T00:06:55Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="Asp.Net MVC" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" />		<summary type="html"><![CDATA[ Download the example here. Asp.Net MVC has a cool way to add validation errors from the model and display them all into the View. It?s actually using the ModelState. As you may know NHibernate Validator (NHV) is a framework to &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/04/02/nhibernate-validator-and-aspnet-mvc/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/04/02/nhibernate-validator-and-aspnet-mvc/">&lt;h4&gt; &lt;a href="http://darioquintana.googlecode.com/files/MvcNhvExample.zip"&gt;Download the example here.&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Asp.Net MVC has a cool way to add validation errors from the model and display them all into the View. It?s actually using the ModelState. As you may know NHibernate Validator (NHV) is a framework to validate entities, so what about if we let the validation to the framework that can manage it? So the integration of NHV to Asp.Net MVC is easy. I created a new Asp.Net MVC project and added some files to my solution to make they look like this: &lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://darioquintana.com.ar/files/MvcNhv00.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;First I added the libraries needed to NHV (this libraries we need in case to use NHibernate too, otherwise you don?t need Linfu stuff to get proxies working). The libraries are:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/MvcNhv05.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Once the libraries are referenced, NHV need to be initialized, actually in this example that initialization will consist in a Validator Engine provider, capable to be accessed from everywhere into our web-application. A good point do this, is in the Global.asax. The next method &lt;em&gt;InitializeValidator&lt;/em&gt; it?s called from the &lt;em&gt;Application_Start&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/MvcNhv03.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Then I created a new View Manage.aspx, actually the view is a copy, with modifications, of Register.aspx View. Such View should looks like this one. As you may see, seems like there are some messages of validation, means, a validation that didn?t pass.  Now let?s see the code to explore the minimal code to introduce NHibernate Validator as a Framework to Validate our MVC application.&lt;img src="http://darioquintana.com.ar/files/MvcNhv01.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;First of all, our entity Customer, which reflex the view with a Name and a Email properties, should looks like this with the NHV attributes. Remember that NHV can be configured using Attributes (default), Xml or Fluent-Interfaces, and accept mix of configurations too.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/MvcNhv04.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Second, we need the integration point between NHibernate Validator and Asp.Net MVC, and that point consist just in a little piece of code that make the validation and modifies the current state of the model. We need just a few lines:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/MvcNhv01.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The picture shows an extension method which first of all, get a new ValidatorEngine instance, which is a singleton in whole web application. Actually, to use a ValidatorEngine we need just one instance, because NHV make a lot of useful caching and it configure itself in the way we are using it. Then we validate the entity and get all the InvalidValues of the object. If the entity is in invalid state (break one rule defined), NHV we well generate a InvalidValue array with all errors we should show to the user. Iterate through all the items and we add them all to the ModelState. Once we add one model error, the model is no longer valid.&lt;/p&gt;
&lt;p&gt;Once we have our extension, let?s use it.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/MvcNhv02.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Validate Method is the extension we made before, and that method is going to modify the ModelState if it?s needed.&lt;/p&gt;
&lt;p&gt;And that?s all folks, hope this helps.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/n58pymya-jg9N08cj5Kv3Ymm98U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n58pymya-jg9N08cj5Kv3Ymm98U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/n58pymya-jg9N08cj5Kv3Ymm98U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n58pymya-jg9N08cj5Kv3Ymm98U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/Q2zr6f4qGxA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/04/02/nhibernate-validator-and-aspnet-mvc/#comments" thr:count="11" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/04/02/nhibernate-validator-and-aspnet-mvc/feed/atom/" thr:count="11" />
		<thr:total>11</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/04/02/nhibernate-validator-and-aspnet-mvc/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[NHibernate Validator 1.2 alpha3]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/weP7nBG9uws/" />
		<id>http://darioquintana.com.ar/blogging/?p=64</id>
		<updated>2009-03-30T12:54:41Z</updated>
		<published>2009-03-30T12:54:41Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" />		<summary type="html"><![CDATA[Download NHibernate Validator 1.2 alpha3 with sources and binaries here This release demostrate to be very stable and is an update to use it with NHibernate 2.1alpha2. For those who have NH.Validator 1.2alpha1 this is a mandatory update. Enjoy it &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/03/30/nhibernate-validator-12-alpha3/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/03/30/nhibernate-validator-12-alpha3/">&lt;p&gt;&lt;img src="http://darioquintana.com.ar/files/NHV-logo-white-background.png" /&gt;&lt;/p&gt;
&lt;p&gt;Download NHibernate Validator 1.2 alpha3 with sources and binaries &lt;a href="http://is.gd/pxyc"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This release demostrate to be very stable and is an update to use it with NHibernate 2.1alpha2. For those who have NH.Validator 1.2alpha1 this is a mandatory update.&lt;/p&gt;
&lt;p&gt;Enjoy it !&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/71FuQnx542FbpvYxcbhx12um4II/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/71FuQnx542FbpvYxcbhx12um4II/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/71FuQnx542FbpvYxcbhx12um4II/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/71FuQnx542FbpvYxcbhx12um4II/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/weP7nBG9uws" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/03/30/nhibernate-validator-12-alpha3/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/03/30/nhibernate-validator-12-alpha3/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/03/30/nhibernate-validator-12-alpha3/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[New NHibernate and NHibernate Validator releases]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/xgjZMMIAYVY/" />
		<id>http://darioquintana.com.ar/blogging/?p=61</id>
		<updated>2009-03-16T14:51:13Z</updated>
		<published>2009-03-16T14:51:13Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Contrib" /><category scheme="http://darioquintana.com.ar/blogging" term="NHibernate.Validator" />		<summary type="html"><![CDATA[NHibernate 2.1 alpha1. See official release. Download. NHibernate.Validator 1.2 alpha1. See official release. Download.]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/03/16/new-nhibernate-and-nhibernate-validator-releases/">&lt;ul&gt;
&lt;li&gt;NHibernate 2.1 alpha1. &lt;a href="http://nhforge.org/blogs/nhibernate/archive/2009/03/15/nhibernate-2-1-0-on-the-road.aspx"&gt;See official release&lt;/a&gt;. &lt;a href="https://sourceforge.net/project/platformdownload.php?group_id=73818"&gt;Download&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;NHibernate.Validator 1.2 alpha1. &lt;a href="http://nhforge.org/blogs/nhibernate/archive/2009/03/16/nhibernate-validator-1-2-alpha1-released.aspx"&gt;See official release&lt;/a&gt;. &lt;a href="https://sourceforge.net/project/showfiles.php?group_id=216446&amp;amp;package_id=275108"&gt;Download&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SF4sfpTuQDuCR4Cvdtqf0G-OaLY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SF4sfpTuQDuCR4Cvdtqf0G-OaLY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SF4sfpTuQDuCR4Cvdtqf0G-OaLY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SF4sfpTuQDuCR4Cvdtqf0G-OaLY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/xgjZMMIAYVY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/03/16/new-nhibernate-and-nhibernate-validator-releases/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/03/16/new-nhibernate-and-nhibernate-validator-releases/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/03/16/new-nhibernate-and-nhibernate-validator-releases/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Dario</name>
						<uri>http://darioquintana.com.ar/</uri>
					</author>
		<title type="html"><![CDATA[Registering FREETEXT or CONTAINS functions into a NHibernate dialect]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DarioQuintana/~3/LQtsKQ_MXus/" />
		<id>http://darioquintana.com.ar/blogging/?p=59</id>
		<updated>2009-03-13T15:23:37Z</updated>
		<published>2009-03-13T15:19:38Z</published>
		<category scheme="http://darioquintana.com.ar/blogging" term="NHibernate" />		<summary type="html"><![CDATA[Ms Sql Server FREETEXT and CONTAINS functions are used into FullText search capabilities to querying. These functions are of course natives to this particular RDBMS and even comes a with particular structure: they don?t return a value. So far, till &#8230;<p class="read-more"><a href="http://darioquintana.com.ar/blogging/2009/03/13/registering-freetext-or-contains-functions-into-a-nhibernate-dialect/">Read more &#187;</a></p>]]></summary>
		<content type="html" xml:base="http://darioquintana.com.ar/blogging/2009/03/13/registering-freetext-or-contains-functions-into-a-nhibernate-dialect/">&lt;p&gt;Ms Sql Server FREETEXT and CONTAINS functions are used into FullText search capabilities to querying. These functions are of course natives to this particular RDBMS and even comes a with particular structure: they don?t return a value. So far, till NH 2.0, you couldn?t do it because a little parser issue, but from &lt;b&gt;NHibernate 2.1&lt;/b&gt; in forward you?re enable register them.&lt;/p&gt;
&lt;p&gt;First of all, we define the new dialect with the new functions in order that when we run a query, NHibernate can recognize those functions and can transform to native-sql, in this case, Transact-SQL.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;using&lt;/span&gt; NHibernate.Dialect;
&lt;span class="kwrd"&gt;using&lt;/span&gt; NHibernate.Dialect.Function;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MyCompany.Data
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MyDialect : MsSql2008Dialect
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; MyDialect()
        {
            RegisterFunction(&lt;span class="str"&gt;"freetext"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; StandardSQLFunction(&lt;span class="str"&gt;"freetext"&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;));
            RegisterFunction(&lt;span class="str"&gt;"contains"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; StandardSQLFunction(&lt;span class="str"&gt;"contains"&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;));
        }
    }
}&lt;/pre&gt;
&lt;p&gt;Note that we are using &lt;b&gt;StandardSQLFunction&lt;/b&gt;, we can also use &lt;b&gt;SQLFunctionTemplate&lt;/b&gt; or implement our &lt;b&gt;ISQLFunction&lt;/b&gt; class with all the constraints (ie: parameter number accepted) we need.&lt;/p&gt;
&lt;p&gt;Once our new dialect is ready let?s call it from our &lt;i&gt;hibernate.cfg.xml&lt;/i&gt; file, then NHibernate can know that this dialect will be inject. Suppose &lt;b&gt;MyDialect&lt;/b&gt; is placed into the assembly &lt;b&gt;MyCompany.Data&lt;/b&gt;, so the configuration file should look like this:&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-8"&lt;/span&gt; ?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;hibernate-configuration&lt;/span&gt;  &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="urn:nhibernate-configuration-2.2"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;session-factory&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="NH"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="dialect"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;MyCompany.Data.MyDialect, MyCompany.Data&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="connection.connection_string"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Data Source=(local)\sqlexpress;Initial Catalog=test;Integrated Security = true
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="proxyfactory.factory_class"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;property&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;session-factory&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;hibernate-configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Everything is ready, you just have to do this 2 steps and the functions are ready to use it, then we can query using them.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;
session.CreateQuery(&lt;span class="str"&gt;"from Documento where freetext(Texto,:keywords)"&lt;/span&gt;)
    .SetString(&lt;span class="str"&gt;"keywords"&lt;/span&gt;,&lt;span class="str"&gt;"hey apple car"&lt;/span&gt;)
    .List();&lt;/pre&gt;
&lt;p&gt;Note the above query is HQL, so NHibernate knows about &lt;b&gt;freetext&lt;/b&gt; and can operate with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dj3q8wm37zGL8_lIxflq8CRavqU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dj3q8wm37zGL8_lIxflq8CRavqU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dj3q8wm37zGL8_lIxflq8CRavqU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dj3q8wm37zGL8_lIxflq8CRavqU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DarioQuintana/~4/LQtsKQ_MXus" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://darioquintana.com.ar/blogging/2009/03/13/registering-freetext-or-contains-functions-into-a-nhibernate-dialect/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://darioquintana.com.ar/blogging/2009/03/13/registering-freetext-or-contains-functions-into-a-nhibernate-dialect/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://darioquintana.com.ar/blogging/2009/03/13/registering-freetext-or-contains-functions-into-a-nhibernate-dialect/</feedburner:origLink></entry>
	</feed>

