<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Xaf on ZeroSharp</title><link>https://www.zerosharp.com/blog/categories/xaf/</link><description>Recent content in Xaf on ZeroSharp</description><generator>Hugo</generator><language>en-gb</language><copyright>Copyright © 2012–{year} Robert Anderson</copyright><lastBuildDate>Sun, 06 Nov 2016 18:39:00 +0100</lastBuildDate><atom:link href="https://www.zerosharp.com/blog/categories/xaf/index.xml" rel="self" type="application/rss+xml"/><item><title>Smart hiding of the selection boxes in XAF web applications</title><link>https://www.zerosharp.com/smart-hiding-of-the-selection-boxes-in-xaf-web-applications/</link><pubDate>Sun, 06 Nov 2016 18:39:00 +0100</pubDate><guid>https://www.zerosharp.com/smart-hiding-of-the-selection-boxes-in-xaf-web-applications/</guid><description>&lt;p&gt;When an &lt;a href="https://www.devexpress.com/products/net/application_framework/"&gt;XAF&lt;/a&gt; list view has no selection-based actions available, the selection box still appears in the grid. Users get confused. In this post, we&amp;rsquo;ll look at a workaround.&lt;/p&gt;
&lt;h2 id="the-problem"&gt;The problem&lt;/h2&gt;
&lt;p&gt;In the XAF MainDemo, lets make Departments read-only for the User role.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;userRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddTypePermissionsRecursively&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Department&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;SecurityOperations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SecurityPermissionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Deny&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;userRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddTypePermissionsRecursively&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Department&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;SecurityOperations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SecurityPermissionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Deny&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;userRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddTypePermissionsRecursively&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Department&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;SecurityOperations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Delete&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SecurityPermissionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Deny&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Then start the web application, login as John and navigate to the Departments list view. There is a column selection box, but it serves no purpose. There are no actions that depend on a grid selection.&lt;/p&gt;</description></item><item><title>An XAF workaround for 'Prevent this page from creating additional dialogs.'</title><link>https://www.zerosharp.com/an-xaf-workaround-for-prevent-this-page-from-creating-additional-dialogs-dot/</link><pubDate>Mon, 16 May 2016 13:51:00 +0100</pubDate><guid>https://www.zerosharp.com/an-xaf-workaround-for-prevent-this-page-from-creating-additional-dialogs-dot/</guid><description>&lt;p&gt;Both Chrome and Firefox have a &amp;lsquo;feature&amp;rsquo; which allows a user to ignore future calls to &lt;code&gt;confirm()&lt;/code&gt;. Once this has been checked, any subsequent calls to &lt;code&gt;confirm()&lt;/code&gt; return false immediately without showing the window.&lt;/p&gt;
&lt;p&gt;In XAF, this behaviour prevents the application from working correctly. For instance, it becomes impossible to confirm a deletion.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/prevent-this-page-001.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The following controller provides a work around. It injects some javascript into the page wrapping the call to &lt;code&gt;confirm()&lt;/code&gt;. The new code detects when the &lt;strong&gt;Prevent this page from creating additional dialogs&lt;/strong&gt; checkbox has been checked and returns true instead. The confirmation window still does not appear, but the XAF application works as if the user had pressed confirm instead of cancel.&lt;/p&gt;</description></item><item><title>DevExpress 2015.2 review part 2</title><link>https://www.zerosharp.com/devexpress-15-dot-2-review-part-2/</link><pubDate>Thu, 10 Dec 2015 09:43:00 +0100</pubDate><guid>https://www.zerosharp.com/devexpress-15-dot-2-review-part-2/</guid><description>&lt;p&gt;This is the second and final dive into some of the new DevExpress XAF 2015.2 features. The &lt;a href="https://www.zerosharp.com/devexpress-15-dot-2-review-part-1/"&gt;first part&lt;/a&gt; covers the Report Designer and the new XML serialisation.&lt;/p&gt;
&lt;h2 id="batch-editing"&gt;Batch editing&lt;/h2&gt;
&lt;p&gt;Another feature I&amp;rsquo;m excited about is the support for batch editing within the web application grids.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see what happens when combined with the validation rules. What happens if I edit two rows but only one has a validation problem - does the whole batch get rejected? Or just the row with the problem?&lt;/p&gt;</description></item><item><title>DevExpress 2015.2 review part 1</title><link>https://www.zerosharp.com/devexpress-15-dot-2-review-part-1/</link><pubDate>Wed, 09 Dec 2015 14:43:00 +0100</pubDate><guid>https://www.zerosharp.com/devexpress-15-dot-2-review-part-1/</guid><description>&lt;p&gt;Last week, DevExpress released 2015.2.3, their second major version of the year.&lt;/p&gt;
&lt;p&gt;There are already some good blog posts about the changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeproject.com/Tips/1060260/Whats-New-for-XAF"&gt;Michael Bogaerts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://vimarx.com/blog/92/"&gt;Gustavo Marzioni&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.devexpress.com/Subscriptions/New-2015.xml?product=xaf"&gt;DevExpress What&amp;rsquo;s New&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Rather than repeat general overviews provided in these, this two-part blog post is more of a &amp;lsquo;deep dive&amp;rsquo;. In particular I&amp;rsquo;ll be looking at two of the new features in the expressApp Framework (XAF).
Today I&amp;rsquo;ll cover the new XML serialisation in the report designer. Tomorrow&amp;rsquo;s post will examine the new batch editing features.&lt;/p&gt;</description></item><item><title>Migrating a large web application from XAF 12.1 to 15.1 - Part 3</title><link>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-3/</link><pubDate>Wed, 16 Sep 2015 09:39:00 +0100</pubDate><guid>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-3/</guid><description>&lt;p&gt;This is the third part of a &lt;a href="https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-2"&gt;series&lt;/a&gt; about migrating a large application from XAF 12.1 to XAF 15.1. In this part I will compare the results of a simple stress test between the versions.&lt;/p&gt;
&lt;p&gt;I have described in previous posts how to &lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;stress test XAF applications&lt;/a&gt;. One of our most basic tests is to simulate 25 users cycling through all the navigation tabs for an hour. I&amp;rsquo;m happy to report there is a considerable improvement under load in version 15.1.&lt;/p&gt;</description></item><item><title>Migrating a large web application from XAF 12.1 to 15.1 - Part 2</title><link>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-2/</link><pubDate>Tue, 15 Sep 2015 10:37:00 +0100</pubDate><guid>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-2/</guid><description>&lt;p&gt;This is the second part of a &lt;a href="https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-1"&gt;series&lt;/a&gt; about migrating a large application from XAF 12.1 to XAF 15.1.&lt;/p&gt;
&lt;p&gt;In the 13.1 release, DevExpress made a change to the way XAF &lt;code&gt;Validator&lt;/code&gt; class is used. It now requires an &lt;code&gt;IObjectSpace&lt;/code&gt; parameter corresponding to the object. It is needed to correctly evaluate any rules which are descendants of the &lt;code&gt;RuleSearchObjectProperties&lt;/code&gt;. These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;RuleCombinationOfPropertiesIsUnique&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RuleIsReferenced&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RuleObjectExists&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RuleUniqueValue&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A lot of our code has been around for years now and the older parts rely heavily on &lt;code&gt;Session&lt;/code&gt; and &lt;code&gt;UnitOfWork&lt;/code&gt; instead of &lt;code&gt;IObjectSpace&lt;/code&gt; For the most part our application used &lt;code&gt;IObjectSpace&lt;/code&gt; only within &lt;code&gt;ViewControllers&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Migrating a large web application from XAF 12.1 to 15.1 - Part 1</title><link>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-1/</link><pubDate>Mon, 14 Sep 2015 10:01:00 +0100</pubDate><guid>https://www.zerosharp.com/migrating-a-large-web-application-from-xaf-12-dot-1-to-15-dot-1-part-1/</guid><description>&lt;p&gt;I am the principal software architect for a treasury application in use by over 100 large multinational corporates. Upgrades are generally met with reluctance in the enterprise world and so we&amp;rsquo;ve been somewhat stuck on an old version of the expressAppFramework.&lt;/p&gt;
&lt;p&gt;Recently I&amp;rsquo;ve been pushing to move to the newer version and I have spent about three weeks migrating the substantial code base to XAF 15.1 and .NET 4.6.&lt;/p&gt;
&lt;p&gt;The steps are:&lt;/p&gt;</description></item><item><title>Force a complete garbage collection in an ASP.NET application.</title><link>https://www.zerosharp.com/force-a-complete-garbage-collection-in-an-asp-dot-net-application/</link><pubDate>Wed, 05 Aug 2015 09:26:00 +0100</pubDate><guid>https://www.zerosharp.com/force-a-complete-garbage-collection-in-an-asp-dot-net-application/</guid><description>&lt;p&gt;How can I force a full garbage collection easily within an ASP.NET application? The method here is for XAF web applications but the same approach should work with any ASP.NET app.&lt;/p&gt;



&lt;p&gt;First up: Never mess with the .NET garbage collector.&lt;/p&gt;
&lt;p&gt;I sometimes mess with the garbage collector in .NET when I&amp;rsquo;m trying to pin down some memory problem. Also, after &lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;a load test&lt;/a&gt;, I prefer to force the garbage collector to collect everything it can so that I can check that the memory drops as expected.&lt;/p&gt;</description></item><item><title>Fixing slow debugging of ASP.NET applications</title><link>https://www.zerosharp.com/fixing-slow-debugging-of-asp-dot-net-applications/</link><pubDate>Wed, 03 Jun 2015 21:31:00 +0100</pubDate><guid>https://www.zerosharp.com/fixing-slow-debugging-of-asp-dot-net-applications/</guid><description>&lt;p&gt;For a while I&amp;rsquo;ve noticed an annoying slowness when debugging ASP.NET applications from Visual Studio. Just after every page load it takes about a second before the buttons become clickable. I noticed mostly when debugging XAF applications, perhaps because the pages are quite complex.&lt;/p&gt;
&lt;p&gt;Turns out the culprit is something called &lt;a href="http://www.asp.net/visual-studio/overview/2013/using-browser-link"&gt;Browser Link&lt;/a&gt; which was introduced in Visual Studio 2013. It&amp;rsquo;s enabled by default.&lt;/p&gt;
&lt;p&gt;To turn it off you can turn it off from the menu:&lt;/p&gt;</description></item><item><title>DevExpress 14.2 review</title><link>https://www.zerosharp.com/devexpress-14-dot-2-review/</link><pubDate>Tue, 20 Jan 2015 08:35:00 +0100</pubDate><guid>https://www.zerosharp.com/devexpress-14-dot-2-review/</guid><description>&lt;p&gt;This post is an overview of the brand new version XAF 14.2. The truly outstanding new feature is the ASP.NET report writer which is now available in all XAF applications.&lt;/p&gt;
&lt;p&gt;A few months ago, we lost a potential sale because the customer wanted the ability to create custom reports from within the browser. We told them it was impossible to provide a fully-fledged report designer within our web application - but the DevExpress guys have done it! And how!&lt;/p&gt;</description></item><item><title>ELMAH with DevExpress XAF</title><link>https://www.zerosharp.com/elmah-with-devexpress-xaf/</link><pubDate>Wed, 08 Oct 2014 15:45:00 +0100</pubDate><guid>https://www.zerosharp.com/elmah-with-devexpress-xaf/</guid><description>&lt;p&gt;&lt;a href="https://code.google.com/p/elmah/"&gt;ELMAH (Error Logging Modules and Handlers)&lt;/a&gt; is an open source library for logging unhandled exceptions. This post explains how to get it running with the &lt;a href="https://www.devexpress.com/Products/NET/Application_Framework/"&gt;DevExpress XAF&lt;/a&gt; main demo.&lt;/p&gt;
&lt;p&gt;A couple of amazing facts about ELMAH.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It has been around since 2004!&lt;/li&gt;
&lt;li&gt;It was written by &lt;a href="http://www.raboof.com/"&gt;Atif Aziz&lt;/a&gt; who happens to be an old school-friend from the International School of Geneva.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;XAF provides &lt;a href="https://documentation.devexpress.com/#xaf/CustomDocument2704"&gt;quite extensive error handling options&lt;/a&gt; out of the box, but I have found Elmah better suited to production environments because of the ability to remotely view the full error log.&lt;/p&gt;</description></item><item><title>A web UI performance tip for XAF web applications</title><link>https://www.zerosharp.com/a-web-ui-performance-tip-for-xaf-web-applications/</link><pubDate>Mon, 31 Mar 2014 10:16:00 +0100</pubDate><guid>https://www.zerosharp.com/a-web-ui-performance-tip-for-xaf-web-applications/</guid><description>&lt;p&gt;The purpose of this post is to raise your awareness of a toggle which exists in the &lt;a href="http://www.devexpress.com/xaf/"&gt;DevExpress XAF framework&lt;/a&gt; which can significantly improve UI performance in the web application.&lt;/p&gt;



&lt;p&gt;The biggest XAF project I work with has one very complex business object. The layout for this screen includes about 100 properties, several nested tabs, some custom editors, several collection properties and a whole lot of &lt;a href="https://documentation.devexpress.com/#Xaf/CustomDocument3286"&gt;Conditional Appearance&lt;/a&gt; rules. It was very sluggish to navigate - it was taking several seconds to load the detail view and then it was very slow switching between tabs. Switching to edit mode was also slow.&lt;/p&gt;</description></item><item><title>Provisioning a new development machine with BoxStarter</title><link>https://www.zerosharp.com/provisioning-a-new-development-machine-with-boxstarter/</link><pubDate>Tue, 25 Feb 2014 15:29:00 +0100</pubDate><guid>https://www.zerosharp.com/provisioning-a-new-development-machine-with-boxstarter/</guid><description>&lt;p&gt;I&amp;rsquo;ve been playing around with &lt;a href="http://boxstarter.org/"&gt;Boxstarter&lt;/a&gt; to configure my entire development environment with hardly any user intervention.&lt;/p&gt;
&lt;img class="img-right" src="https://www.zerosharp.com/images/blog/boxstarter-001.png" alt="300"&gt;
&lt;p&gt;Here are the steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Windows 8.1 on a new machine.&lt;/li&gt;
&lt;li&gt;Login.&lt;/li&gt;
&lt;li&gt;Open a command prompt and enter the following.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;START http://boxstarter.org/package/nr/url?http://bit.ly/1kapDXI
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That&amp;rsquo;s it!&lt;/p&gt;
&lt;p&gt;Boxstarter will self-install via ClickOnce, asking for various confirmations and ultimately it will prompt you for your login password. (This gets saved and encrypted to allow for unattended reboots and re-logins during the installation). Then the real magic begins. Boxstarter downloads and installs all your tools and configures your environment, rebooting as necessary. An hour later your full development setup is installed, including Visual Studio 2013, any VS extensions, any other programs and tools, all the browsers you need, all critical Windows updates, etc. You just saved yourself a couple of days of work and a lot of hassle.&lt;/p&gt;</description></item><item><title>Glimpse with DevExpress XAF</title><link>https://www.zerosharp.com/glimpse-with-devexpress-xaf/</link><pubDate>Tue, 17 Dec 2013 12:41:00 +0100</pubDate><guid>https://www.zerosharp.com/glimpse-with-devexpress-xaf/</guid><description>&lt;p&gt;I have finally got around to getting Glimpse working with XAF. Glimpse is an amazing extensible ASP.NET plug-in which gives you valuable information about what is going on within your server in production. It&amp;rsquo;s also very pretty.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s jump right in and have a look at what XAF looks like with Glimpse running.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/xaf-with-glimpse-016.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;That banner along the bottom of the screen is the Glimpse heads up display (HUD). Hovering over various sections of it pops up more information:&lt;/p&gt;</description></item><item><title>DevExpress 13.2 Review - Part 2</title><link>https://www.zerosharp.com/devexpress-13-dot-2-review-part-2/</link><pubDate>Tue, 10 Dec 2013 16:10:00 +0100</pubDate><guid>https://www.zerosharp.com/devexpress-13-dot-2-review-part-2/</guid><description>&lt;p&gt;This is the second part of a review of the new DevExpress 13.2. In &lt;a href="https://www.zerosharp.com/devexpress-13-dot-2-review-part-1"&gt;the last part&lt;/a&gt; we looked in-depth at the new &lt;a href="https://community.devexpress.com/blogs/eaf/archive/2013/11/08/easy-large-reports-in-13-2-ctp-of-reportsv2-module.aspx"&gt;Reports V2&lt;/a&gt;. In this part I&amp;rsquo;ll go over some of the other new features including the support for warnings and confirmations in the validation module.&lt;/p&gt;
&lt;h2 id="soft-validation-rules"&gt;Soft Validation Rules&lt;/h2&gt;
&lt;p&gt;With 13.2, DevExpress adds support for warning/confirmation messages to the validation engine. Warnings can be used to handle an unusual but valid data entry. An example would be:&lt;/p&gt;</description></item><item><title>DevExpress 13.2 Review - Part 1</title><link>https://www.zerosharp.com/devexpress-13-dot-2-review-part-1/</link><pubDate>Mon, 02 Dec 2013 16:23:00 +0100</pubDate><guid>https://www.zerosharp.com/devexpress-13-dot-2-review-part-1/</guid><description>&lt;p&gt;The first version of XAF I ever installed was called &lt;em&gt;eXpressApp-1.0.CTP2.exe&lt;/em&gt; in July 2006! It has certainly come a long way since then.&lt;/p&gt;
&lt;p&gt;This post is the first part of an overview of the brand new version XAF 13.2 which will be released any day now. This part is an in-depth review of the new report writer features (still in beta).&lt;/p&gt;
&lt;h2 id="reports-v2"&gt;Reports V2&lt;/h2&gt;
&lt;p&gt;Prior to this version, XAF reports were not source code. They were objects serialized to a file and then loaded into the database during initialisation. This has a lot of shortcomings some of which I have addressed in previous &lt;a href="https://www.zerosharp.com/making-xaf-reports-even-better-part-1/"&gt;blog posts&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>How to improve XAF grid layout for Chrome</title><link>https://www.zerosharp.com/how-to-improve-xaf-grid-layout-for-chrome/</link><pubDate>Fri, 08 Nov 2013 09:55:00 +0100</pubDate><guid>https://www.zerosharp.com/how-to-improve-xaf-grid-layout-for-chrome/</guid><description>&lt;p&gt;This post proposes a workaround for a specific XAF rendering problem related to recent versions of Google Chrome.&lt;/p&gt;
&lt;p&gt;Here is an XAF list view as it looks with IE 10 and DevExpress 13.1.8.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/chrome-grid-layout-001.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;This is how the same view looks with Chrome 30. Notice how the column widths are rendered poorly. The minimum space is given to the string field and the date and bool fields are too wide.&lt;/p&gt;</description></item><item><title>Three ways to store a list of currency codes in XAF</title><link>https://www.zerosharp.com/three-ways-to-store-a-list-of-currency-codes-in-xaf/</link><pubDate>Tue, 22 Oct 2013 18:15:00 +0100</pubDate><guid>https://www.zerosharp.com/three-ways-to-store-a-list-of-currency-codes-in-xaf/</guid><description>&lt;p&gt;In the &lt;a href="https://www.zerosharp.com/the-ugly-the-heavy-and-the-good"&gt;last post&lt;/a&gt; we looked at three solutions to a relatively simple XAF requirement. In this post I&amp;rsquo;ll discuss another XAF challenge, explain the options and provide a versatile and maintainable solution.&lt;/p&gt;
&lt;p&gt;In my DevExpress XAF application, I have an object which has several properties like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/currency-list-editor-002.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;In each case, the field is a comma-separated list of currency codes. These fields are not very important to the model - they are used mainly for reporting.&lt;/p&gt;</description></item><item><title>The Ugly, the Heavy and the Good: 3 solutions to an XAF layout problem</title><link>https://www.zerosharp.com/the-ugly-the-heavy-and-the-good/</link><pubDate>Mon, 14 Oct 2013 09:51:00 +0100</pubDate><guid>https://www.zerosharp.com/the-ugly-the-heavy-and-the-good/</guid><description>&lt;p&gt;This post aims to look at various solutions to a seemingly simple layout change.&lt;/p&gt;
&lt;p&gt;With &lt;a href="https://www.devexpress.com/Products/NET/Application_Framework/"&gt;DevExpress XAF&lt;/a&gt;, a lot of the difficult things are easy: authentication, authorisation, ORM, reporting, complex form layouts, themes, etc., are all made easy by XAF. On the other hand, some of the easy things are hard. It can be frustratingly difficult to make a small modification to the basic layout. We will look at an example of such a change and evaluate the recommended DevExpress approaches.&lt;/p&gt;</description></item><item><title>A review of NDepend 5</title><link>https://www.zerosharp.com/a-review-of-ndepend-5/</link><pubDate>Wed, 02 Oct 2013 17:54:00 +0100</pubDate><guid>https://www.zerosharp.com/a-review-of-ndepend-5/</guid><description>&lt;p&gt;NDepend is a commercial static analysis tool for .NET managed code. It&amp;rsquo;s been around a long time (since 2004!). Version 5 was just released and in this post I&amp;rsquo;m going to try it out on the DevExpress MainDemo.&lt;/p&gt;



&lt;p&gt;In the past I have always thought of NDepend as a complex tool. I was never sure where to start. In version 5, a lot of work has been done to improve the learning curve. The installation process is easy and a wizard very quickly points you in the right direction.&lt;/p&gt;</description></item><item><title>MiniProfiler with DevExpress XAF</title><link>https://www.zerosharp.com/miniprofiler-with-devexpress-xaf/</link><pubDate>Tue, 27 Aug 2013 09:14:00 +0100</pubDate><guid>https://www.zerosharp.com/miniprofiler-with-devexpress-xaf/</guid><description>&lt;p&gt;In this post I will demonstrate how to add &lt;a href="http://miniprofiler.com/"&gt;MiniProfiler&lt;/a&gt; to the XAF MainDemo web application.&lt;/p&gt;
&lt;p&gt;MiniProfiler is a simple fast profiler with a pretty user interface. It is fast because it only profiles code that you have explicitly decorated with the &lt;code&gt;MiniProfiler.Step()&lt;/code&gt; method. It was designed by the team at &lt;a href="http://stackoverflow.com/"&gt;StackOverflow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;First, add the MiniProfiler NuGet package to the MainDemo.Web project. Then add a placeholder to &lt;em&gt;default.aspx&lt;/em&gt; just before the last &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;</description></item><item><title>Fluent queries with DevExpress XPO - Implementation</title><link>https://www.zerosharp.com/fluent-queries-with-devexpress-xpo-implementation/</link><pubDate>Wed, 14 Aug 2013 11:03:00 +0100</pubDate><guid>https://www.zerosharp.com/fluent-queries-with-devexpress-xpo-implementation/</guid><description>&lt;p&gt;Continuing from my &lt;a href="https://www.zerosharp.com/fluent-queries-with-devexpress-xpo-intro"&gt;last post&lt;/a&gt;, I&amp;rsquo;ll demonstrate how to create a fluent interface so that you can do:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Session&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InTransaction&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Contacts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ByPosition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Developer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ThatHave&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NoPhoto&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;And&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TasksInProgress&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;And&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TasksWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Priority&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;High&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FirstOrDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;First, let&amp;rsquo;s look at the &amp;lsquo;beginning&amp;rsquo; of the fluent interface: the &lt;code&gt;Query()&lt;/code&gt; extension method.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;QueryExtensions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="n"&gt;IQueries&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="n"&gt;Session&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Queries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// If we&amp;#39;re using XAF, do the same for ObjectSpace as well&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="n"&gt;IQueries&lt;/span&gt; &lt;span class="n"&gt;Query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="n"&gt;IObjectSpace&lt;/span&gt; &lt;span class="n"&gt;objectSpace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;xpObjectSpace&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;objectSpace&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;XPObjectSpace&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xpObjectSpace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Queries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;What does the &lt;code&gt;Queries()&lt;/code&gt; class look like?&lt;/p&gt;</description></item><item><title>Fluent queries with DevExpress XPO - Intro</title><link>https://www.zerosharp.com/fluent-queries-with-devexpress-xpo-intro/</link><pubDate>Mon, 12 Aug 2013 17:54:00 +0100</pubDate><guid>https://www.zerosharp.com/fluent-queries-with-devexpress-xpo-intro/</guid><description>&lt;p&gt;There are &lt;a href="http://documentation.devexpress.com/#xaf/CustomDocument3052"&gt;many ways to perform queries with XPO&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can do this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FindObject&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Contact&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;BinaryOperator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Elvis&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;or this&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FindObject&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Contact&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;CriteriaOperator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Name = &amp;#39;Elvis&amp;#39;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Another way to use the &lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument2537"&gt;simplified criteria syntax&lt;/a&gt;, and with the &lt;a href="https://code.google.com/p/dxcorecommunityplugins/wiki/XPO_EasyFields"&gt;Xpo_EasyFields CodeRush plugin&lt;/a&gt;. Then you can do:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c#" data-lang="c#"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FindObject&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Contact&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;Customer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fields&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Elvis&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For each of the above, you can optionally query within the transaction by passing in the &lt;code&gt;PersistentCriteriaEvaluationBehavior.InTransaction&lt;/code&gt; parameter.&lt;/p&gt;
&lt;p&gt;Or we can use LINQ via &lt;code&gt;XPQuery&amp;lt;T&amp;gt;.TransformExpression()&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Session.FindObject&amp;lt;Contact&amp;gt;(
 XPQuery&amp;lt;Contact&amp;gt;.TransformExpression(Session, c =&amp;gt; c.Name == &amp;#34;Elvis&amp;#34;)
 );
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;All of these methods are powerful, but the power comes at a cost. The syntax is neither elegant nor particularly clear and as a result it is not very practical to maintain or test.&lt;/p&gt;</description></item><item><title>Making XAF reports even better - Part 2</title><link>https://www.zerosharp.com/making-xaf-reports-even-better-part-2/</link><pubDate>Tue, 28 May 2013 11:51:00 +0100</pubDate><guid>https://www.zerosharp.com/making-xaf-reports-even-better-part-2/</guid><description>&lt;p&gt;Good news. The conversion is now two-way. Get the source code &lt;a href="https://github.com/ZeroSharp/Xaf_MainDemo_ReportSync"&gt;from GitHub&lt;/a&gt;. Make sure you have built MainDemo.Reports project.&lt;/p&gt;
&lt;p&gt;You will find there are now two T4 transforms in the project. &lt;em&gt;RepxToCSharp.tt&lt;/em&gt; is covered in the &lt;a href="https://www.zerosharp.com/making-xaf-reports-even-better-part-1"&gt;Part 1&lt;/a&gt;. It searches for any &lt;em&gt;.repx&lt;/em&gt; files in the solution and converts the scripts into compilable C#.&lt;/p&gt;
&lt;p&gt;The second transform is new. &lt;em&gt;CSharpToRepx.tt&lt;/em&gt; copies any changes to the script part back into the original &lt;em&gt;.repx&lt;/em&gt; files. Again, there are performance optimisations via checksums to prevent overwriting unchanged files.&lt;/p&gt;</description></item><item><title>Making XAF reports even better - Part 1</title><link>https://www.zerosharp.com/making-xaf-reports-even-better-part-1/</link><pubDate>Tue, 21 May 2013 14:38:00 +0100</pubDate><guid>https://www.zerosharp.com/making-xaf-reports-even-better-part-1/</guid><description>&lt;p&gt;The ability to create reports using a report writer is a very powerful feature of &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/"&gt;DevExpress XAF&lt;/a&gt;, but there are some limitations which are particularly cumbersome to deal with in complex project.&lt;/p&gt;
&lt;p&gt;One of the projects I work on has over 100 reports in it. Even though we make use of unit tests to ensure they are not broken, the maintenance of the code in the embedded scripts is particularly difficult to manage.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Bonus - Simultaneous EasyTests</title><link>https://www.zerosharp.com/load-testing-xaf-bonus-simultaneous-easytests/</link><pubDate>Mon, 22 Apr 2013 16:31:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-bonus-simultaneous-easytests/</guid><description>&lt;p&gt;In &lt;a href="https://www.zerosharp.com/load-testing-xaf-overview"&gt;my recent series on load testing XAF&lt;/a&gt;, I used a Selenium javascript test to run the client browser instances. This is a good and cheap method of validating the performance of XAF applications under production load.&lt;/p&gt;
&lt;p&gt;However, if the load tests fail because of a concurrency bug or a performance bottleneck, it can still be difficult to analyse and solve. For this, we need to be able to simulate load locally against the development environment.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Part 5 - Analysis</title><link>https://www.zerosharp.com/load-testing-xaf-part-5-analysis/</link><pubDate>Sun, 14 Apr 2013 07:37:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-part-5-analysis/</guid><description>&lt;p&gt;This is the final post in a series about load testing XAF applications. Previously in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;Load Testing XAF: Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;Part 1: Deploying the target webserver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-2-selenium/"&gt;Part 2: Selenium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-3-uploading-and-validating-the-virtual-user-script/"&gt;Part 3: Uploading and validating a script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-4-launching-the-load-test/"&gt;Part 4: Launching the load test&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this part, we analyse the results of the load test we ran in &lt;a href="https://www.zerosharp.com/load-testing-xaf-part-3-uploading-and-validating-the-virtual-user-script/"&gt;Part 4&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="results"&gt;Results&lt;/h2&gt;
&lt;p&gt;The results of the test we ran are &lt;a href="https://load.wpm.neustar.biz/load/test/share/e0f547d711624168bc7fa0a69ddd8283"&gt;here&lt;/a&gt;. The graphs are interactive and give quite interesting data about the load tests. Feel free to have a look and play around with the results.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Part 4 - Launching the load test</title><link>https://www.zerosharp.com/load-testing-xaf-part-4-launching-the-load-test/</link><pubDate>Mon, 08 Apr 2013 11:19:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-part-4-launching-the-load-test/</guid><description>&lt;p&gt;This is another post in a series about load testing XAF applications. Previously in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;Load Testing XAF: Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;Part 1: Deploying the target webserver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-2-selenium/"&gt;Part 2: Selenium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-3-uploading-and-validating-the-virtual-user-script/"&gt;Part 3: Uploading and validating a script&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this part, we will launch a 1 hour test with 25 virtual users using the &lt;a href="http://home.wpm.neustar.biz/"&gt;NeuStar Web Performance Management&lt;/a&gt; module.&lt;/p&gt;
&lt;h2 id="schedule-and-launch-a-test"&gt;Schedule and launch a test&lt;/h2&gt;
&lt;p&gt;From the script validation screen, click on &lt;em&gt;Schedule a load test with this script&lt;/em&gt;. The defaults are good, but you can specify in detail how to run your load test. For instance, you can coordinate multiple Selenium scripts to simulate different types of activity on your site.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Part 3 - Uploading and Validating the Virtual User Script</title><link>https://www.zerosharp.com/load-testing-xaf-part-3-uploading-and-validating-the-virtual-user-script/</link><pubDate>Wed, 03 Apr 2013 16:39:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-part-3-uploading-and-validating-the-virtual-user-script/</guid><description>&lt;p&gt;This is another post in a series about load testing XAF applications. Previously in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;Load Testing XAF: Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;Part 1: Deploying the target webserver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-2-selenium/"&gt;Part 2: Selenium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this part, we will load test the application we set up in &lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;Part 1&lt;/a&gt;, using the Selenium load test we created in &lt;a href="https://www.zerosharp.com/load-testing-xaf-part-2-selenium/"&gt;Part 2&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="neustar-web-performance-management"&gt;Neustar Web Performance Management&lt;/h2&gt;
&lt;p&gt;NeuStar (formerly BrowserMob) are a company specialised in web application performance monitoring. We are interested in their &lt;a href="https://home.wpm.neustar.biz/"&gt;web performance module&lt;/a&gt;. It is free to create an account. To run a test with less than 25 virtual users costs only $0.15 per virtual user. Tests with more than 25 users (up to 5000) require an additional paid plan.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Part 2 - Selenium</title><link>https://www.zerosharp.com/load-testing-xaf-part-2-selenium/</link><pubDate>Thu, 28 Mar 2013 16:56:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-part-2-selenium/</guid><description>&lt;h1 id="writing-a-selenium-user-test-against-maindemo"&gt;Writing a Selenium User Test against MainDemo&lt;/h1&gt;
&lt;p&gt;This is another post in a series about load testing XAF applications. Previously in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;Load Testing XAF: Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/load-testing-xaf-part-1-deploying/"&gt;Part 1: Deploying the target webserver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="why-not-use-devexpress-easytests"&gt;Why not use DevExpress EasyTests?&lt;/h2&gt;
&lt;p&gt;The DevExpress recommended method of writing functional tests is to use the EasyTest functionality of the expressAppFramework. This has several advantages over other functional testing approaches.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It uses a domain specific language tailored for XAF making it easy to test views and actions&lt;/li&gt;
&lt;li&gt;It makes it easy to interact with the DevExpress controls that are used within XAF&lt;/li&gt;
&lt;li&gt;A single EasyTest can be run against both the ASP.NET and WinForms applications&lt;/li&gt;
&lt;li&gt;EasyTests work against both the debug webserver and IIS&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, one feature which is not (yet) available is the ability to use EasyTests for load testing.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Part 1 - Deploying</title><link>https://www.zerosharp.com/load-testing-xaf-part-1-deploying/</link><pubDate>Fri, 22 Mar 2013 11:21:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-part-1-deploying/</guid><description>&lt;p&gt;This is the first part of a tutorial about load testing XAF applications. See the &lt;a href="https://www.zerosharp.com/load-testing-xaf-overview/"&gt;overview&lt;/a&gt; for a bit of background. In this post we set up the target webserver.&lt;/p&gt;
&lt;p&gt;You can target any machine which has a publicly available web address, but for this tutorial, I&amp;rsquo;m&amp;rsquo; deploying the MainDemo to the Amazon cloud, by following the instructions in &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/"&gt;Part 1&lt;/a&gt; and &lt;a href="http://blog.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/"&gt;Part 2&lt;/a&gt; of my previous series about Amazon Web Services.&lt;/p&gt;
&lt;p&gt;I am using version 12.2.7 of the DevExpress XAF MainDemo. There are a couple of extra changes to make to the web.config.&lt;/p&gt;</description></item><item><title>Load Testing XAF: Overview</title><link>https://www.zerosharp.com/load-testing-xaf-overview/</link><pubDate>Tue, 12 Mar 2013 18:20:00 +0100</pubDate><guid>https://www.zerosharp.com/load-testing-xaf-overview/</guid><description>&lt;p&gt;Over the next few posts, I will demonstrate how to load test XAF web applications.&lt;/p&gt;
&lt;h2 id="history"&gt;History&lt;/h2&gt;
&lt;p&gt;Performance testing has traditionally been difficult and expensive. A few years ago, to do it well required a powerful piece of dedicated load testing software such as HP LoadRunner (typical cost back in 2007: USD 50,000-100,000 or more per year!). This software was capable of simulating multiple virtual users via the use of recorded scripts and providing detailed performance statistics. Usually the cost was increased further increased by the need for powerful hardware to be able to run the application.&lt;/p&gt;</description></item><item><title>Better handling of Decimals in the XAF audit trail</title><link>https://www.zerosharp.com/better-handling-of-decimals-in-the-xaf-audit-trail/</link><pubDate>Tue, 15 Jan 2013 10:29:00 +0100</pubDate><guid>https://www.zerosharp.com/better-handling-of-decimals-in-the-xaf-audit-trail/</guid><description>&lt;p&gt;The following screenshot shows the detail view of an object change from the DevExpress XAF Audit Trail. The &lt;code&gt;DecimalValue&lt;/code&gt; property was changed from 123.45 to 543.22.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/audit-trail-001.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Why is the &lt;code&gt;OldValue&lt;/code&gt; property is displayed with two trailing zeros? The corresponding property is defined as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;span class="lnt"&gt;23
&lt;/span&gt;&lt;span class="lnt"&gt;24
&lt;/span&gt;&lt;span class="lnt"&gt;25
&lt;/span&gt;&lt;span class="lnt"&gt;26
&lt;/span&gt;&lt;span class="lnt"&gt;27
&lt;/span&gt;&lt;span class="lnt"&gt;28
&lt;/span&gt;&lt;span class="lnt"&gt;29
&lt;/span&gt;&lt;span class="lnt"&gt;30
&lt;/span&gt;&lt;span class="lnt"&gt;31
&lt;/span&gt;&lt;span class="lnt"&gt;32
&lt;/span&gt;&lt;span class="lnt"&gt;33
&lt;/span&gt;&lt;span class="lnt"&gt;34
&lt;/span&gt;&lt;span class="lnt"&gt;35
&lt;/span&gt;&lt;span class="lnt"&gt;36
&lt;/span&gt;&lt;span class="lnt"&gt;37
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;[DefaultClassOptions]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;XPObject&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Session&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;//...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;_DecimalValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt; [ModelDefault(&amp;#34;DisplayFormat&amp;#34;, &amp;#34;{0:n2}&amp;#34;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;DecimalValue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;get&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_DecimalValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;set&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;SetPropertyValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;DecimalValue&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;ref&lt;/span&gt; &lt;span class="n"&gt;_DecimalValue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="n"&gt;XPCollection&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;AuditDataItemPersistent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_ChangeHistory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;XPCollection&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;AuditDataItemPersistent&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ChangeHistory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;get&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_ChangeHistory&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;_ChangeHistory&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AuditedObjectWeakReference&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetAuditTrail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_ChangeHistory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="explanation-and-fix"&gt;Explanation and fix&lt;/h3&gt;
&lt;p&gt;A C# &lt;code&gt;decimal&lt;/code&gt; is a type which represents a number&amp;rsquo;s value &lt;em&gt;and its precision&lt;/em&gt;. It actually stores the number of trailing zeros along with the value. For the &lt;code&gt;NewValue&lt;/code&gt;, it has stored the decimal value as the user entered it - with no trailing zeros. Howevever, for the &lt;code&gt;OldValue&lt;/code&gt;, it has retrieved the value from the database and used the SQL column definition to determine the precision.&lt;/p&gt;</description></item><item><title>Deploy XAF ASP.NET Applications to Amazon Web Services: Part 5</title><link>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-5-load-balancing/</link><pubDate>Wed, 05 Dec 2012 11:03:00 +0100</pubDate><guid>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-5-load-balancing/</guid><description>&lt;h2 id="part-5-load-balancing"&gt;Part 5: Load balancing&lt;/h2&gt;
&lt;p&gt;This is the final post in this 5 part series about deploying XAF to the Amazon cloud. The other parts are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/"&gt;Part 1 - Creating a database in RDS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/"&gt;Part 2 - Deploying to ElasticBeanstalk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-3-troubleshooting-via-remote-desktop/"&gt;Part 3 - Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-4-incremental-deployment/"&gt;Part 4 - Incremental Deployment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This part covers load balancing and autoscaling.&lt;/p&gt;
&lt;h3 id="load-balancing"&gt;Load balancing&lt;/h3&gt;
&lt;p&gt;In order to enable load balancing with DevExpress XAF applications, you must activate client affinity (sticky sessions) which you can do in the &lt;strong&gt;Load Balancer tab&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Deploy XAF ASP.NET Applications to Amazon Web Services: Part 4</title><link>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-4-incremental-deployment/</link><pubDate>Mon, 05 Nov 2012 14:16:00 +0100</pubDate><guid>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-4-incremental-deployment/</guid><description>&lt;h2 id="part-4-incremental-deployment"&gt;Part 4: Incremental Deployment&lt;/h2&gt;
&lt;p&gt;This is the fourth post in a series about deploying ASP.NET applications to the Amazon cloud. In the first three posts covered deploying the XAF ASP.NET MainDemo to the Amazon cloud (&lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/"&gt;Part 1&lt;/a&gt;, &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/"&gt;Part 2&lt;/a&gt;, &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-3-troubleshooting-via-remote-desktop/"&gt;Part 3&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;When we deployed to the Elastic Beanstalk in &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/"&gt;Part 2&lt;/a&gt;, we chose &lt;em&gt;not&lt;/em&gt; to enable incremental deployment.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.zerosharp.com/images/blog/aws/launch-aws-beanstalk-2.jpg" alt="figure 11"&gt;&lt;/p&gt;
&lt;p&gt;I want to explain this decision further.&lt;/p&gt;
&lt;p&gt;If you choose not to deploy incrementally your deployment will take longer because the entire web deployment package needs to be uploaded every time you re-publish which takes about 4-5 minutes on my connection. The incremental deployment option creates a git repository in the target environment so that only the modified files are re-deployed. If you are frequently making changes and redploying, you can save considerable time. A re-deployment takes only a few seconds.&lt;/p&gt;</description></item><item><title>Deploy XAF ASP.NET Applications to Amazon Web Services: Part 3</title><link>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-3-troubleshooting-via-remote-desktop/</link><pubDate>Fri, 02 Nov 2012 17:54:00 +0100</pubDate><guid>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-3-troubleshooting-via-remote-desktop/</guid><description>&lt;h1 id="part-3-troubleshooting"&gt;Part 3: Troubleshooting&lt;/h1&gt;
&lt;p&gt;This is the third post in a series about deploying ASP.NET applications to the Amazon cloud.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/"&gt;Part 1&lt;/a&gt; we created an Amazon RDS instance of SQL Server to act as the database for the deployment.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/"&gt;Part 2&lt;/a&gt; we published the DevExpress MainDemo.Web to the Amazon Elastic Beanstalk.&lt;/p&gt;
&lt;p&gt;In this part we will look at troubleshooting methods and in particular how to connect to an EC2 instance in order to troubleshoot installations.&lt;/p&gt;</description></item><item><title>Deploy XAF ASP.NET Applications to Amazon Web Services: Part 2</title><link>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/</link><pubDate>Wed, 31 Oct 2012 12:52:00 +0100</pubDate><guid>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-2-publishing-maindemo/</guid><description>&lt;h1 id="part-2-publishing-maindemo"&gt;Part 2: Publishing MainDemo&lt;/h1&gt;
&lt;p&gt;This is the second post in a series about deploying ASP.NET applications to the &lt;a href="http://aws.amazon.com/"&gt;Amazon cloud&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/"&gt;Part 1&lt;/a&gt; we created an Amazon RDS instance of SQL Server to act as the database for the deployment. Make sure this is up and running before continuing.&lt;/p&gt;
&lt;p&gt;This part guides you through publishing the &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/"&gt;DevExpress XAF&lt;/a&gt; MainDemo application to the Amazon Elastic Beanstalk.&lt;/p&gt;
&lt;h2 id="amazon-elastic-beanstalk"&gt;Amazon Elastic Beanstalk&lt;/h2&gt;



&lt;p&gt;Amazon Elastic Beanstalk provides automatic capacity provisioning, load balancing, auto-scaling, and application health monitoring. &lt;strong&gt;That sounds like a lot of features we don&amp;rsquo;t really need&lt;/strong&gt; for the MainDemo, so let me explain.&lt;/p&gt;</description></item><item><title>Deploy XAF ASP.NET Applications to Amazon Web Services: Part 1</title><link>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/</link><pubDate>Tue, 23 Oct 2012 12:52:00 +0100</pubDate><guid>https://www.zerosharp.com/deploy-xaf-asp-dot-net-applications-to-amazon-web-services-part-1-putting-the-database-in-the-cloud/</guid><description>&lt;h1 id="part-1-putting-the-database-in-the-cloud"&gt;Part 1: Putting the Database in the Cloud&lt;/h1&gt;
&lt;p&gt;This is the first part of a tutorial for installing the DevExpress MainDemo.Web to Amazon Web Services, but the same principles apply to any ASP.NET web application.&lt;/p&gt;
&lt;p&gt;This part covers creating an Amazon RDS instance running SQL Server Express and connecting a (locally running) MainDemo to it.&lt;/p&gt;
&lt;p&gt;At the time of writing the DevExpress version is 12.1.7.&lt;/p&gt;
&lt;h2 id="amazon-web-services"&gt;Amazon Web Services&lt;/h2&gt;
&lt;p&gt;If you have not already done so, you will need to sign up with &lt;a href="http://aws.amazon.com/"&gt;Amazon Web Services&lt;/a&gt;. There are costs associated with AWS, but the tutorial only uses very small cheap instances which cost as little as 2 cents per hour to run. Also, new customers get a load of hours for free as part of the &lt;a href="http://aws.amazon.com/free/"&gt;AWS Free Usage Tier&lt;/a&gt;. See the &lt;a href="http://aws.amazon.com/ec2/pricing/"&gt;AWS pricing&lt;/a&gt; for more information. Don&amp;rsquo;t forget to terminate your instances when you have finished.&lt;/p&gt;</description></item><item><title>A look at the DevExpress MainDemo with Google Page Speed</title><link>https://www.zerosharp.com/a-look-at-the-devexpress-maindemo-with-google-page-speed/</link><pubDate>Wed, 12 Sep 2012 17:22:00 +0100</pubDate><guid>https://www.zerosharp.com/a-look-at-the-devexpress-maindemo-with-google-page-speed/</guid><description>&lt;p&gt;In this post I&amp;rsquo;ll demonstrate how to use the &lt;a href="https://developers.google.com/speed/pagespeed/"&gt;Google Page Speed&lt;/a&gt; tools to analyse the performance of the DevExpress XAF MainDemo.&lt;/p&gt;
&lt;p&gt;The easiest way to run Google Page Speed is as a Chrome or Firefox plugin. Both are available &lt;a href="https://developers.google.com/speed/pagespeed/insights_extensions"&gt;here&lt;/a&gt;. I use Chrome.&lt;/p&gt;
&lt;p&gt;Now open the DevExpress MainDemo from Visual Studio. By default it is installed to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C:\Users\Public\Documents\DXperience 12.1 Demos\eXpressApp Framework\MainDemo\CS\MainDemo.sln
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Set the MainDemo.Web as the startup project and change the connection string in web.config if necessary. Launch the application with Chrome and login as &amp;lsquo;Sam&amp;rsquo; (password is blank). Then press &lt;code&gt;F12&lt;/code&gt; to bring up the developer tools. The last tab is the Page Speed Analysis and your browser should look like this:&lt;/p&gt;</description></item><item><title>Testing the property signatures of DevExpress validation rules using NUnit and LINQ</title><link>https://www.zerosharp.com/testing-the-property-signatures-of-devexpress-validation-rules-using-nunit-and-linq/</link><pubDate>Thu, 24 May 2012 16:39:00 +0100</pubDate><guid>https://www.zerosharp.com/testing-the-property-signatures-of-devexpress-validation-rules-using-nunit-and-linq/</guid><description>&lt;p&gt;One of the projects I work on uses the validation module of the &lt;a href="http://devexpress.com/Products/NET/Application_Framework/"&gt;eXpressApp Framework (XAF)&lt;/a&gt;. Since the business logic is complex, there are many validation rules defined using the &lt;code&gt;[RuleFromBoolProperty]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One of the recurring problems occurs when the signature of the associated property is incorrect. Consider the following:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;[RuleFromBoolProperty(&amp;#34;Invoice_IsAmountGreaterThanZero&amp;#34;, 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt; DefaultContexts.Save, 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt; &amp;#34;Invoice amount must be greater than zero.&amp;#34;, 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt; UsedProperties = &amp;#34;Amount&amp;#34;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;IsAmountGreaterThanZero&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;get&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Amount&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Notice that the rule is declared &lt;code&gt;public&lt;/code&gt;. This causes the getter to be executed when it is not required (see the &lt;a href="http://documentation.devexpress.com/#Xaf/clsDevExpressPersistentValidationRuleFromBoolPropertyAttributetopic"&gt;note&lt;/a&gt; in the documentation). However another problem is that the default behaviour for public properties of XPObjects is to persist them to the datastore which means the application will attempt to create a new column called &lt;code&gt;IsAmountGreaterThanZero&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>