<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Umbraco Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/category/umbraco/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/category/umbraco/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Wed, 29 May 2019 11:26:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Straight A&#8217;s in WebPagetest with Umbraco</title>
		<link>https://blogit.create.pt/andresantos/2018/11/27/straight-as-in-webpagetest-with-umbraco/</link>
					<comments>https://blogit.create.pt/andresantos/2018/11/27/straight-as-in-webpagetest-with-umbraco/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Tue, 27 Nov 2018 21:40:06 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Microsoft Azure]]></category>
		<category><![CDATA[azure cdn]]></category>
		<category><![CDATA[blobstorage]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[imageprocessor]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[UmbracoFileSystemProviders.Azure]]></category>
		<category><![CDATA[WebPagetest]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=7450</guid>

					<description><![CDATA[<p>Before launching a new website, there&#8217;s a checklist I go through, to make sure that everything is ready. One of the items in my checklist is to test the website against WebPagetest. WebPagetest is a tool that was originally developed by AOL for use internally and was open-sourced in 2008 under a BSD license. The [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2018/11/27/straight-as-in-webpagetest-with-umbraco/">Straight A&#8217;s in WebPagetest with Umbraco</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap dropcap3">B</span>efore launching a new website, there&#8217;s a checklist I go through, to make sure that everything is ready. One of the items in my checklist is to test the website against <strong>WebPagetest</strong>.</p>
<blockquote class="td_quote_box td_box_right"><p>WebPagetest is a tool that was originally developed by <a href="http://dev.aol.com/">AOL</a> for use internally and was open-sourced in 2008 under a BSD license. The online version at <a href="https://www.webpagetest.org/">www.webpagetest.org</a> is run for the benefit of the performance community with several companies and individuals providing the testing infrastructure around the globe.</p></blockquote>
<p>This tool tests any website against 6 major performance affecting factors, and provides a myriad of graphs and logs that make abundantly clear what might be slowing down your site.</p>
<p>In this post I&#8217;ll provide ways to make your site get straight A&#8217;s in WebPagetest.</p>
<p><span id="more-7450"></span></p>
<h1>Setup</h1>
<p>To start this off, let&#8217;s setup our environment. We&#8217;ll just need the following:</p>
<ul>
<li>Visual Studio 2017</li>
<li>Microsoft Azure account</li>
</ul>
<p>In Visual Studio, let&#8217;s create a new empty ASP.NET Web Application project. Then, we&#8217;ll need the latest and greatest Umbraco NuGet package (I used version 7.12.4). Once it finishes installing, just launch the website and install Umbraco with all defaults. This will bootstrap Umbraco with the Starter Website, which we&#8217;ll use as our &#8220;guinea pig&#8221; for WebPagetest.</p>
<p>Next: publish it! We can use the publish wizard to automatically create our new WebApp and SQL Database in Azure. Before installing Umbraco in Azure, we&#8217;ll need to change the Web.config so that the install wizard is run again (I use <a href="https://filezilla-project.org/">Filezilla</a> to change it in Azure):</p>
<p>Clear the Umbraco version number:</p>
<pre class="brush: xml; title: Web.config; notranslate">
&lt;add key=&quot;umbracoConfigurationStatus&quot; value=&quot;&quot;&gt;
</pre>
<p>Clear the Umbraco connection string:</p>
<pre class="brush: xml; title: Web.config; notranslate">
&lt;add name=&quot;umbracoDbDSN&quot; connectionstring=&quot;&quot; providername=&quot;System.Data.SqlClient&quot;&gt;
</pre>
<p>With these changes in place, we&#8217;re good to go. This time, we&#8217;ll not use the defaults in the Umbraco install wizard, since we&#8217;ll want to use the SQL Database we&#8217;ve just created in Azure.</p>
<h1>First test</h1>
<p>For our tests, we&#8217;ll use the people page of the Starter Website. This is the score I got with a standard (S0) database and a basic WebApp:</p>
<p><img decoding="async" class="size-medium wp-image-7454 aligncenter" src="https://blogit.create.pt////wp-content/uploads/2018/09/first-webpagetest-300x91.png" alt="" width="300" height="91" srcset="https://blogit.create.pt/wp-content/uploads/2018/09/first-webpagetest-300x91.png 300w, https://blogit.create.pt/wp-content/uploads/2018/09/first-webpagetest-768x233.png 768w, https://blogit.create.pt/wp-content/uploads/2018/09/first-webpagetest-696x211.png 696w, https://blogit.create.pt/wp-content/uploads/2018/09/first-webpagetest.png 841w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Since this is a very small site, only used for demonstration purposes, half of the metrics are already cleared! However, this is not usually the case for bigger websites. For this reason, I&#8217;ll still present some solutions to improve the grade for these metrics.</p>
<h1>First Byte Time</h1>
<p><em>These test measures the time it takes for the first byte to reach the client&#8217;s browser after the initial http request.</em></p>
<p>There are two main factors that influence this result:</p>
<ul>
<li>Server power</li>
<li>The webpage complexity (integrations with external services, complex logic involved, etc)</li>
</ul>
<h3>How to get an A</h3>
<p>The easiest way to mitigate this problem is by caching. You can see how to do output caching in Umbraco by reading this old post of mine: <a href="https://blogit.create.pt////andresantos/2016/06/30/umbraco-and-donut-output-cache/">https://blogit.create.pt////andresantos/2016/06/30/umbraco-and-donut-output-cache/</a>.</p>
<h1>Keep-alive Enabled</h1>
<p><em>Keep alive is a method to allow the same tcp connection for HTTP conversation instead of opening a new one with each new request.</em></p>
<h3>How to get an A</h3>
<p>This setting is active by default in IIS, so, it&#8217;s also active by default in Azure WebApps, so it&#8217;s easy to get an A!</p>
<h1>Compress Transfer</h1>
<p><em>Gzip compresses your webpages, style sheets and javascripts, before sending them over to the browser. This drastically reduces transfer time since the files are much smaller.</em></p>
<h3>How to get an A</h3>
<p>Just add this setting to your Web.config file:</p>
<pre class="brush: xml; title: Web.config; notranslate">
&lt;httpcompression dynamiccompressionenablecpuusage=&quot;0&quot; dynamiccompressiondisablecpuusage=&quot;90&quot; nocompressionforhttp10=&quot;false&quot; nocompressionforproxies=&quot;false&quot;&gt;
    &lt;statictypes&gt;
        &lt;add mimetype=&quot;text/*&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;message/*&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/javascript&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/font-woff&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/font-woff2&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/vnd.ms-fontobject&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/octet-stream&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;*/*&quot; enabled=&quot;false&quot;&gt;
    &lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/statictypes&gt;
    &lt;dynamictypes&gt;
        &lt;add mimetype=&quot;text/*&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;message/*&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;application/javascript&quot; enabled=&quot;true&quot;&gt;
        &lt;add mimetype=&quot;*/*&quot; enabled=&quot;false&quot;&gt;
    &lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/add&gt;&lt;/dynamictypes&gt;
&lt;/httpcompression&gt;
</pre>
<h1>Compress Images</h1>
<p><em><span class="ILfuVd">Image compression is minimizing the size in bytes of a graphics file without degrading the quality of the image to an unacceptable level.</span></em></p>
<h3>How to get an A</h3>
<p>In Umbraco, to get an A in this grade, you need to do two things:</p>
<ol>
<li>Crop every image and use srcsets where you can</li>
<li>Use the PostProcessor plugin for Image Processor</li>
</ol>
<p>Cropping an image is easy in Umbraco:</p>
<pre class="brush: xml; title: People.cshtml; notranslate">
&lt;div class=&quot;employee-grid__item__image&quot; style=&quot;background-image: url('@person.Photo.GetCropUrl(width: 323, height: 300, quality: 85)')&quot;&gt;&lt;/div&gt;
</pre>
<p>In order to use the PostProcessor plugin, you just need to install it via nuget: <a href="https://www.nuget.org/packages/ImageProcessor.Web.PostProcessor/1.3.1.25">https://www.nuget.org/packages/ImageProcessor.Web.PostProcessor/1.3.1.25</a>.</p>
<h1>Cache Static Content</h1>
<p><em>Static content is content that changes rarely. For this reason it can be cached in the user&#8217;s browser to avoid downloading the same file over and over again.</em></p>
<h3>How to get an A</h3>
<p>Just set the time it takes for the content to expire in the user&#8217;s browser and add extra mime types if you want:</p>
<pre class="brush: xml; title: Web.config; notranslate">
&lt;staticcontent&gt;
    &lt;clientcache cachecontrolmode=&quot;UseMaxAge&quot; cachecontrolmaxage=&quot;7.24:00:00&quot;&gt;
    &lt;remove fileextension=&quot;.air&quot;&gt;
    &lt;mimemap fileextension=&quot;.air&quot; mimetype=&quot;application/vnd.adobe.air-application-installer-package+zip&quot;&gt;
    &lt;remove fileextension=&quot;.svg&quot;&gt;
    &lt;mimemap fileextension=&quot;.svg&quot; mimetype=&quot;image/svg+xml&quot;&gt;
    &lt;remove fileextension=&quot;.woff&quot;&gt;
    &lt;mimemap fileextension=&quot;.woff&quot; mimetype=&quot;application/x-font-woff&quot;&gt;
    &lt;remove fileextension=&quot;.woff2&quot;&gt;
    &lt;mimemap fileextension=&quot;.woff2&quot; mimetype=&quot;application/x-font-woff2&quot;&gt;
    &lt;remove fileextension=&quot;.less&quot;&gt;
    &lt;mimemap fileextension=&quot;.less&quot; mimetype=&quot;text/css&quot;&gt;
    &lt;remove fileextension=&quot;.mp4&quot;&gt;
    &lt;mimemap fileextension=&quot;.mp4&quot; mimetype=&quot;video/mp4&quot;&gt;
    &lt;remove fileextension=&quot;.json&quot;&gt;
    &lt;mimemap fileextension=&quot;.json&quot; mimetype=&quot;application/json&quot;&gt;
&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/mimemap&gt;&lt;/remove&gt;&lt;/clientcache&gt;&lt;/staticcontent&gt;
</pre>
<h1>Effective use of CDN</h1>
<p><em> A content delivery network (CDN) refers to a geographically distributed group of servers which work together to provide fast delivery of Internet content. A CDN allows for the quick transfer of assets needed for loading Internet content including HTML pages, javascript files, stylesheets, images, and videos.</em></p>
<h3>How to get an A</h3>
<p>In Umbraco, you can achieve this last grade by doing two things:</p>
<ol>
<li>Use an Azure Blob Storage for media storage by installing this nuget package: <a href="https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure">https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure</a>.</li>
<li>Create an Azure CDN for serving these blobs through a content delivery network.</li>
</ol>
<p>After creating an Azure CDN service and waiting about an hour for it to be available, the following presents my configuration for the media assets to be provided by it:</p>
<pre class="brush: xml; title: config/imageprocessor/security.config; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?--&gt;
&lt;security&gt;
  &lt;services&gt;
    &lt;service name=&quot;LocalFileImageService&quot; type=&quot;ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web&quot;&gt;
    &lt;!--Disable the LocalFileImageService and enable this one when using virtual paths. --&gt;
    &lt;service prefix=&quot;media/&quot; name=&quot;CloudImageService&quot; type=&quot;ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web&quot;&gt;
      &lt;settings&gt;
        &lt;setting key=&quot;Container&quot; value=&quot;media&quot;&gt;
        &lt;setting key=&quot;MaxBytes&quot; value=&quot;8194304&quot;&gt;
        &lt;setting key=&quot;Timeout&quot; value=&quot;30000&quot;&gt;
        &lt;setting key=&quot;Host&quot; value=&quot;https://&lt;umbracositename&gt;.blob.core.windows.net/media&quot;&gt;
      &lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/settings&gt;
    &lt;/service&gt;
  &lt;/service&gt;&lt;/services&gt;
&lt;/security&gt;
</pre>
<pre class="brush: xml; title: config/imageprocessor/security.config; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?--&gt;
&lt;caching currentcache=&quot;AzureBlobCache&quot;&gt;
  &lt;caches&gt;
    &lt;cache name=&quot;AzureBlobCache&quot; type=&quot;ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache&quot; maxdays=&quot;365&quot;&gt;
      &lt;settings&gt;
        &lt;setting key=&quot;CachedStorageAccount&quot; value=&quot;DefaultEndpointsProtocol=https;AccountName=&lt;accountname&gt;;AccountKey=&lt;accountkey&gt;;EndpointSuffix=core.windows.net&quot;&gt;
        &lt;setting key=&quot;CachedBlobContainer&quot; value=&quot;cache&quot;&gt;
        &lt;setting key=&quot;UseCachedContainerInUrl&quot; value=&quot;false&quot;&gt;
        &lt;setting key=&quot;SourceStorageAccount&quot; value=&quot;DefaultEndpointsProtocol=https;AccountName=&lt;accountname&gt;;AccountKey=&lt;accountkey&gt;;EndpointSuffix=core.windows.net&quot;&gt;
        &lt;setting key=&quot;SourceBlobContainer&quot; value=&quot;media&quot;&gt;
        &lt;setting key=&quot;StreamCachedImage&quot; value=&quot;false&quot;&gt;
        &lt;setting key=&quot;CachedCDNRoot&quot; value=&quot;https://&lt;cdnrootname&gt;.azureedge.net&quot;&gt;
        &lt;setting key=&quot;CachedCDNTimeout&quot; value=&quot;1000&quot;&gt;
      &lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/setting&gt;&lt;/settings&gt;
    &lt;/cache&gt;
  &lt;/caches&gt;
&lt;/caching&gt;
</pre>
<h1>Conclusion</h1>
<p>So, if you followed these tips correctly, you&#8217;ll be able to run WebPagetest and get the same result as I did:</p>
<p><img decoding="async" class="wp-image-7937 size-medium aligncenter" src="https://blogit.create.pt////wp-content/uploads/2018/11/straightAs-300x89.png" alt="straightAs" width="300" height="89" srcset="https://blogit.create.pt/wp-content/uploads/2018/11/straightAs-300x89.png 300w, https://blogit.create.pt/wp-content/uploads/2018/11/straightAs-768x228.png 768w, https://blogit.create.pt/wp-content/uploads/2018/11/straightAs-696x207.png 696w, https://blogit.create.pt/wp-content/uploads/2018/11/straightAs.png 837w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>You can find the complete report here: <a href="https://www.webpagetest.org/result/181127_2A_bea6941dcd20d38ab54c29409fca9363/">https://www.webpagetest.org/result/181127_2A_bea6941dcd20d38ab54c29409fca9363/</a>.</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2018/11/27/straight-as-in-webpagetest-with-umbraco/">Straight A&#8217;s in WebPagetest with Umbraco</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2018/11/27/straight-as-in-webpagetest-with-umbraco/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A Solution to DataTokens must contain an &#8216;umbraco-doc-request&#8217; key with a PublishedContentRequest object</title>
		<link>https://blogit.create.pt/marionunes/2018/09/10/a-solution-to-datatokens-must-contain-an-umbraco-doc-request-key-with-a-publishedcontentrequest-object/</link>
					<comments>https://blogit.create.pt/marionunes/2018/09/10/a-solution-to-datatokens-must-contain-an-umbraco-doc-request-key-with-a-publishedcontentrequest-object/#respond</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Mon, 10 Sep 2018 15:42:48 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=7444</guid>

					<description><![CDATA[<p>Hi, If you are experiencing &#8220;DataTokens must contain an &#8216;umbraco-doc-request&#8217; key with a PublishedContentRequest object&#8221;, you might have configured static routes with RouteTable.Routes.MapRoute(&#8230;). Using the default UmbracoHelper Umbraco from Umbraco.Web.Mvc on these static routes might cause this error. The solution is using new UmbracoHelper(UmbracoContext.Current) instead. &#160;</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/09/10/a-solution-to-datatokens-must-contain-an-umbraco-doc-request-key-with-a-publishedcontentrequest-object/">A Solution to DataTokens must contain an &#8216;umbraco-doc-request&#8217; key with a PublishedContentRequest object</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi,</p>
<p>If you are experiencing <strong>&#8220;DataTokens must contain an &#8216;umbraco-doc-request&#8217; key with a PublishedContentRequest object&#8221;</strong>, you might have configured static routes with <strong>RouteTable.Routes.MapRoute(&#8230;)</strong>.</p>
<p>Using the default UmbracoHelper <strong>Umbraco </strong>from Umbraco.Web.Mvc on these static routes might cause this error.</p>
<p>The solution is using <strong>new UmbracoHelper(UmbracoContext.Current) </strong>instead.</p>
<p>&nbsp;</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/09/10/a-solution-to-datatokens-must-contain-an-umbraco-doc-request-key-with-a-publishedcontentrequest-object/">A Solution to DataTokens must contain an &#8216;umbraco-doc-request&#8217; key with a PublishedContentRequest object</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2018/09/10/a-solution-to-datatokens-must-contain-an-umbraco-doc-request-key-with-a-publishedcontentrequest-object/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Adding an Angular app to your Umbraco Website</title>
		<link>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/</link>
					<comments>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/#comments</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Sat, 10 Mar 2018 22:11:23 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[.NET]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=334</guid>

					<description><![CDATA[<p>What problems does this solve? This enables you to have an Angular application alongside your Umbraco website, on a specified route. The Angular App can be protected by the Authentication of your website, if you have it. And you can make use of surface controllers for authenticated requests. The routing of your app will work [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/">Adding an Angular app to your Umbraco Website</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>What problems does this solve?</strong></p>
<ul>
<li>This enables you to have an Angular application alongside your Umbraco website, on a specified route.</li>
<li>The Angular App can be protected by the Authentication of your website, if you have it. And you can make use of surface controllers for authenticated requests.</li>
<li>The routing of your app will work as intended, for example, if your Angular app is at <strong>/app</strong> and you make a request to <strong>/app/products</strong>, the request will be routed to the angular app products&#8217; page.</li>
</ul>
<p><strong>What this is not</strong></p>
<ul>
<li>A complete front end for a Umbraco website with dynamic routes.</li>
<li>This doesn&#8217;t have dynamic routes, you have to specify them on your code.</li>
</ul>
<p><strong>Let&#8217;s get started!</strong></p>
<p>First, start by creating a controller to handle the Angular App request.</p>
<pre class="brush: csharp; title: ; notranslate">
using System.Web.Mvc;

public class AngularAppController : BaseController
{
    public ActionResult AngularAppView()
    {
        return View();
    }
}
</pre>
<p>Then, you have to decide the route where your Angular app will render. On this example it will be <strong>/angularapp</strong>.</p>
<p>On your ApplicationStarted method, put this code:</p>
<pre class="brush: csharp; title: ; notranslate">
RouteTable.Routes.MapRoute(
  &quot;AngularApp&quot;,
  &quot;angularapp/{*.}&quot;,
  new { controller = &quot;AngularApp&quot;, action = &quot;AngularAppView&quot; });
</pre>
<p>The <strong>{*.}</strong> syntax is what makes your angular app routes load and not return the 404 page.</p>
<p>If you don&#8217;t have an ApplicationStarted method, find out how you to create it here: <a href="https://our.umbraco.org/documentation/reference/events/application-startup">https://our.umbraco.org/documentation/reference/events/application-startup</a></p>
<p>Under your Views folder, create a folder with the same name as the <strong>controller</strong> you set in MapRoute. In this case it will be &#8220;AngularApp&#8221;.<br />
Inside it, create a view with the same name as the <strong>action</strong> set you set in MapRoute.<br />
<img decoding="async" src="http://blogit-create.com/wp-content/uploads/2018/03/appview.png" alt="" width="268" height="71" class="alignnone size-full wp-image-414" srcset="https://blogit.create.pt/wp-content/uploads/2018/03/appview.png 268w, https://blogit.create.pt/wp-content/uploads/2018/03/appview-265x71.png 265w" sizes="(max-width: 268px) 100vw, 268px" /></p>
<p>Inside the view put the contents of the index.html of your angular app.<br />
Then you will need to move your angular app files somewhere like you /Assets folder, and edit their paths on the view.</p>
<p>Almost done!</p>
<p>Now you need to edit the routes of your Angular app.<br />
Simply add the route you chose as a prefix to the routes.</p>
<p>From something like this:</p>
<pre class="brush: csharp; title: ; notranslate">
const routes: Routes = &#x5B;
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
  { path: '/dashboard', component: DashboardComponent },
  { path: '/detail/:id', component: HeroDetailComponent },
  { path: '/heroes', component: HeroesComponent }
];
</pre>
<p>To this:</p>
<pre class="brush: csharp; title: ; notranslate">
const routes: Routes = &#x5B;
  { path: 'angularapp', redirectTo: 'angularapp/dashboard', pathMatch: 'full' },
  { path: 'angularapp/dashboard', component: DashboardComponent },
  { path: 'angularapp/detail/:id', component: HeroDetailComponent },
  { path: 'angularapp/heroes', component: HeroesComponent }
];
</pre>
<p>Thanks for reading!<br />
Mário</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/">Adding an Angular app to your Umbraco Website</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2018/03/10/adding-an-angular-app-to-your-umbraco-website/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Force Image Cache Refresh Programmatically</title>
		<link>https://blogit.create.pt/marionunes/2017/11/23/force-image-cache-refresh-programmatically/</link>
					<comments>https://blogit.create.pt/marionunes/2017/11/23/force-image-cache-refresh-programmatically/#comments</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Thu, 23 Nov 2017 18:15:22 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=274</guid>

					<description><![CDATA[<p>The best solution I found, to force the browser cache to refresh for an image, is to modify the image url in the html. Example: I have an image with this url: &#8220;/images/mario-profile-photo.jpeg&#8221;. Change the url to: &#8220;/images/mario-profile-photo.jpeg?updated={DateTime.Now.Ticks}&#8220;. So, I lied, sorry! This will make the browser request the image again, because the url is [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/23/force-image-cache-refresh-programmatically/">Force Image Cache Refresh Programmatically</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The best solution I found, to force the browser cache to refresh for an image, is to modify the image url in the html.</p>
<p>Example:<br />
I have an image with this url: &#8220;/images/mario-profile-photo.jpeg&#8221;.<br />
Change the url to: &#8220;/images/mario-profile-photo.jpeg<strong>?updated={DateTime.Now.Ticks}</strong>&#8220;.</p>
<p><strong>So, I lied, sorry! This will make the browser request the image again, because the url is different. It doesn&#8217;t really refresh the cache.</strong></p>
<p>Using DateTime.Now.Ticks will force the refresh every time the page loads, so <strong>I don&#8217;t recommend using it</strong>.</p>
<p><u>If you have the time of when the photo was last updated, use that instead! Something like: {<strong>Photo.UpdateDate.Ticks</strong>}<br />
This way, you will only request a new image when it is different from the one you already have in cache.<u></u></u></p>
<blockquote><p>Note: the &#8220;?updated=&#8221; property is just a name, you can use whatever you want. The important thing is to modify the url.</p></blockquote>
<p>For Umbraco developers: When saving an image, do not forget to set it&#8217;s UpdateDate! Umbraco doesn&#8217;t update that property automatically.</p>
<p>Hope this helps,<br />
Thanks for reading!<br />
Mário</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/23/force-image-cache-refresh-programmatically/">Force Image Cache Refresh Programmatically</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2017/11/23/force-image-cache-refresh-programmatically/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Syncing Member Types with uSync</title>
		<link>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/</link>
					<comments>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/#respond</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Mon, 06 Nov 2017 11:22:24 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[uSync]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=204</guid>

					<description><![CDATA[<p>This took me longer to figure out than it should have. uSync has MemberType synchronization disabled by default. To enable it simply go to Config\uSyncBackOffice.Config and set MemberTypeHandler to true. &#60;Handlers Group=&#34;default&#34; EnableMissing=&#34;true&#34;&#62; &#60;HandlerConfig Name=&#34;uSync: DataTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: TemplateHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: ContentTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: MediaTypeHandler&#34; Enabled=&#34;true&#34; /&#62; &#60;HandlerConfig Name=&#34;uSync: [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/">Syncing Member Types with uSync</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This took me longer to figure out than it should have.</p>
<p>uSync has MemberType synchronization disabled by default.</p>
<p>To enable it simply go to Config\uSyncBackOffice.Config and set MemberTypeHandler to true.</p>
<pre class="brush: xml; highlight: [11]; title: ; notranslate">
&lt;Handlers Group=&quot;default&quot; EnableMissing=&quot;true&quot;&gt;
    &lt;HandlerConfig Name=&quot;uSync: DataTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: TemplateHandler&quot; Enabled=&quot;true&quot; /&gt;

    &lt;HandlerConfig Name=&quot;uSync: ContentTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MediaTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: LanguageHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: DictionaryHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MacroHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: DataTypeMappingHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MemberTypeHandler&quot; Enabled=&quot;true&quot; /&gt;
    
    &lt;!-- content edition - if installed --&gt;
    &lt;HandlerConfig Name=&quot;uSync: ContentHandler&quot; Enabled=&quot;true&quot; /&gt;
    &lt;HandlerConfig Name=&quot;uSync: MediaHandler&quot; Enabled=&quot;true&quot; /&gt;
&lt;/Handlers&gt;
</pre>
<p>
Thanks for reading!</p>
<p>Mário Nunes</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/">Syncing Member Types with uSync</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2017/11/06/syncing-member-types-with-usync/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working with Umbraco 7.6 New Pickers</title>
		<link>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/</link>
					<comments>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/#respond</comments>
		
		<dc:creator><![CDATA[Mário Nunes]]></dc:creator>
		<pubDate>Sun, 05 Nov 2017 14:01:26 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/marionunes/?p=104</guid>

					<description><![CDATA[<p>With the old pickers, we could do something like this: page.SetValue(&#34;myPicker&#34;, content.Id); With the new pickers, we can&#8217;t use IDs anymore, we have to use UDIs instead. They look like this: "umb://document/28b551d1e9e74c758686604c9168b910" So how can we get the content UDI? If we have an IContent, we can simply use the extension string udi = content.GetUdi().ToString(); [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/">Working with Umbraco 7.6 New Pickers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>With the old pickers, we could do something like this:</p>
<pre class="brush: csharp; title: ; notranslate">
page.SetValue(&quot;myPicker&quot;, content.Id);
</pre>
<p>With the new pickers, we can&#8217;t use IDs anymore, we have to use UDIs instead. They look like this:</p>
<p><code>"umb://document/28b551d1e9e74c758686604c9168b910"</code></p>
<p>So how can we get the content UDI?<br />
If we have an <strong>IContent</strong>, we can simply use the extension</p>
<pre class="brush: csharp; title: ; notranslate">
string udi = content.GetUdi().ToString();
</pre>
<p>If we have an <strong>IPublishedContent</strong>, we need to do a little bit more work.<br />
Umbraco provides a built in function to create UDIs. To use it, we need these:</p>
<pre class="brush: csharp; title: ; notranslate">
using Umbraco.Core;
using static Umbraco.Core.Constants;
</pre>
<p>Get the UDI like this:</p>
<pre class="brush: csharp; title: ; notranslate">
string udi = Udi.Create(UdiEntityType.Document, content.GetKey()).ToString();
</pre>
<blockquote><p>If you want to set <strong>multiple items</strong>, separate the udis with a comma. The resulting string should be like this:<br />
<code>"umb://document/28b551d1e9e74c758686604c9168b910,umb://document/28b551d1e9e74c758686604c9168b912,..."</code></p></blockquote>
<p></p>
<hr>
<p>To clean up the code, I created an extension class.</p>
<pre class="brush: csharp; title: ; notranslate">
    using Umbraco.Core;
    using Umbraco.Core.Models;
    using Umbraco.Web;
    using static Umbraco.Core.Constants;

    public static class UmbracoExtensions
    {
        /// &lt;summary&gt;
        /// Gets the specified content udi.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;content&quot;&gt;The content.&lt;/param&gt;
        /// &lt;returns&gt;The content udi.&lt;/returns&gt;
        public static string GetUdi(this IPublishedContent content)
        {
            return Udi.Create(UdiEntityType.Document, content.GetKey()).ToString();
        }
    }
</pre>
<p>With this extension, you can set the pickers with IPublishedContent with just one line of code!</p>
<pre class="brush: csharp; title: ; notranslate">
page.SetValue(&quot;myPicker&quot;, content.GetUdi());
</pre>
<p></p>
<hr>
<p><strong>So why not use IContent all the time?</strong><br />
To get an IContent, we need to use a service like MediaService or ContentService, they are much slower that getting and IPublishedContent through Umbraco.TypedContent(), which gets it from cache.</p>
<p><strong>UPDATE:</strong> Support for member pickers. Other pickers might need additional code too.</p>
<pre class="brush: csharp; title: ; notranslate">
public static string GetUdi(this IPublishedContent content)
{
    string entityType = UdiEntityType.Document;

    if (string.Equals(Models.Member.ModelTypeAlias, content.ContentType.Alias))
    {
        entityType = UdiEntityType.Member;
    }

    return Udi.Create(entityType, content.GetKey()).ToString();
}
</pre>
<p>Thanks for reading,<br />
Mário Nunes</p>
<p>The post <a href="https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/">Working with Umbraco 7.6 New Pickers</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/marionunes/2017/11/05/working-with-umbraco-7-6-new-pickers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>KendoUI Grid, OData, WebAPI and Entity Framework</title>
		<link>https://blogit.create.pt/andresantos/2017/07/05/kendoui-grid-odata-webapi-and-entity-framework/</link>
					<comments>https://blogit.create.pt/andresantos/2017/07/05/kendoui-grid-odata-webapi-and-entity-framework/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Wed, 05 Jul 2017 10:42:53 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[Backoffice extension]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[entity framework]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[kendoui]]></category>
		<category><![CDATA[odata]]></category>
		<category><![CDATA[sql database]]></category>
		<category><![CDATA[webapi]]></category>
		<category><![CDATA[webapp]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/andresantos/?p=1764</guid>

					<description><![CDATA[<p>In the latest project I was involved with, there was a need to present database tables data directly in the Umbraco&#8217;s backoffice, where all CRUD operations must be supported. This tables could be something like 1000 to 1 million rows and both the website and database would be hosted in Azure, in a WebApp and [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2017/07/05/kendoui-grid-odata-webapi-and-entity-framework/">KendoUI Grid, OData, WebAPI and Entity Framework</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap dropcap3">I</span>n the latest project I was involved with, there was a need to present database tables data directly in the Umbraco&#8217;s backoffice, where all CRUD operations must be supported. This tables could be something like 1000 to 1 million rows and both the website and database would be hosted in Azure, in a WebApp and SQL Database respectively. Users should be able to create complex filters and order the data as they wish as well as update the data individually and in batch.</p>
<p>From the get-go there were some challenges we needed to overcome in order to create an usable system, that was user-friendly, fast, reliable, and where no conflitcts would come up when data was being updated from multiple users.</p>
<p>The solution was a new Umbraco Package we called <em>Search Manager</em> (since the database tables ultimately feed an Azure Search index) that uses <a href="http://demos.telerik.com/kendo-ui/grid/index">Telerik&#8217;s Kendo UI Grid</a>, WebAPI and Entity Framework. The following presents the process it took to reach the end result.</p>
<p><span id="more-6483"></span></p>
<h2>Step 1</h2>
<p>We created a simple Umbraco Package that implemented a Kendo UI Grid which got its data from a WebAPI method that returned all rows from a table using Petapoco.</p>
<p>This allowed us to have the complete table data in memory using a Kendo UI Grid. It worked great but had major problems:</p>
<ul>
<li>A table with around 40k rows was actually a 40 MBs json download in order to populate the grid</li>
<li>Users could be working with outdated data, since it was loaded in memory and changes could have been made to the source</li>
</ul>
<h2>Step 2</h2>
<p>We started using the server paging feature of the Kendo Grid. This dropped the download size greatly, but we still had problems:</p>
<ul>
<li>Even though we are working with only a subset of results client-side, we were still getting the complete table data server-side, using petapoco.</li>
</ul>
<p>We needed an easy way to translate the client-side queries, such as filters, paging, order, etc to SQL queries.</p>
<h2>Step 3</h2>
<p>We changed the type of queries being generated by the Grid to OData. Using the <a href="https://www.nuget.org/packages/Microsoft.AspNet.WebApi.OData">OData WebAPI nuget package</a> we are able to map the odata query  to a C# object and then directly apply the query to any IQueryable data.</p>
<p>Petapoco does not provide any IQueryable data support, so we changed our ORM to Entity Framework, which does, and <em>voilá</em>!</p>
<h2>Finally</h2>
<p>With everything in place, we are able to have a filtered subset of results in a Grid, that gets exactly what it needs to display from a dynamically generated SQL query.</p>
<ul>
<li>It is fast because we only get exactly what we need:</li>
</ul>
<p>An OData query generated by the Kendo UI Grid looks like this:</p>
<pre class="brush: plain; title: ; notranslate">
http://localhost:14231/umbraco/backoffice/SearchManager/PricesApi/Read?%24inlinecount=allpages&%24top=20&%24skip=40&%24orderby=ProviderName+desc&%24filter=(NatureProcCode+eq+%27exames%27+and+AvgAmtClaimed+gt+10)
</pre>
<p>Which is translated to the follwing SQL query:</p>
<pre class="brush: sql; title: ; notranslate">
exec sp_executesql N'SELECT 
    &#x5B;Project1].&#x5B;Approved] AS &#x5B;Approved], 
    &#x5B;Project1].&#x5B;DiffWeightedRate] AS &#x5B;DiffWeightedRate], 
    &#x5B;Project1].&#x5B;SubmitPrvId] AS &#x5B;SubmitPrvId], 
    &#x5B;Project1].&#x5B;PracticeSeq] AS &#x5B;PracticeSeq], 
    &#x5B;Project1].&#x5B;NatureProcCode] AS &#x5B;NatureProcCode], 
    &#x5B;Project1].&#x5B;GroupProcCode] AS &#x5B;GroupProcCode], 
    &#x5B;Project1].&#x5B;Network] AS &#x5B;Network], 
    &#x5B;Project1].&#x5B;AmtClaimedWeighted] AS &#x5B;AmtClaimedWeighted], 
    &#x5B;Project1].&#x5B;ManualPrice] AS &#x5B;ManualPrice], 
    &#x5B;Project1].&#x5B;IsImported] AS &#x5B;IsImported], 
    &#x5B;Project1].&#x5B;DiffCalculatedRate] AS &#x5B;DiffCalculatedRate], 
    &#x5B;Project1].&#x5B;AmtContract] AS &#x5B;AmtContract], 
    &#x5B;Project1].&#x5B;AvgAmtClaimed] AS &#x5B;AvgAmtClaimed], 
    &#x5B;Project1].&#x5B;ProviderName] AS &#x5B;ProviderName], 
    &#x5B;Project1].&#x5B;ClinicName] AS &#x5B;ClinicName]
    FROM ( SELECT 
        &#x5B;Extent1].&#x5B;Approved] AS &#x5B;Approved], 
        &#x5B;Extent1].&#x5B;DiffWeightedRate] AS &#x5B;DiffWeightedRate], 
        &#x5B;Extent1].&#x5B;SubmitPrvId] AS &#x5B;SubmitPrvId], 
        &#x5B;Extent1].&#x5B;PracticeSeq] AS &#x5B;PracticeSeq], 
        &#x5B;Extent1].&#x5B;NatureProcCode] AS &#x5B;NatureProcCode], 
        &#x5B;Extent1].&#x5B;GroupProcCode] AS &#x5B;GroupProcCode], 
        &#x5B;Extent1].&#x5B;Network] AS &#x5B;Network], 
        &#x5B;Extent1].&#x5B;AmtClaimedWeighted] AS &#x5B;AmtClaimedWeighted], 
        &#x5B;Extent1].&#x5B;ManualPrice] AS &#x5B;ManualPrice], 
        &#x5B;Extent1].&#x5B;IsImported] AS &#x5B;IsImported], 
        &#x5B;Extent1].&#x5B;DiffCalculatedRate] AS &#x5B;DiffCalculatedRate], 
        &#x5B;Extent1].&#x5B;AmtContract] AS &#x5B;AmtContract], 
        &#x5B;Extent1].&#x5B;AvgAmtClaimed] AS &#x5B;AvgAmtClaimed], 
        &#x5B;Extent1].&#x5B;ProviderName] AS &#x5B;ProviderName], 
        &#x5B;Extent1].&#x5B;ClinicName] AS &#x5B;ClinicName]
        FROM (SELECT 
    &#x5B;PriceGrid].&#x5B;Approved] AS &#x5B;Approved], 
    &#x5B;PriceGrid].&#x5B;DiffWeightedRate] AS &#x5B;DiffWeightedRate], 
    &#x5B;PriceGrid].&#x5B;SubmitPrvId] AS &#x5B;SubmitPrvId], 
    &#x5B;PriceGrid].&#x5B;PracticeSeq] AS &#x5B;PracticeSeq], 
    &#x5B;PriceGrid].&#x5B;NatureProcCode] AS &#x5B;NatureProcCode], 
    &#x5B;PriceGrid].&#x5B;GroupProcCode] AS &#x5B;GroupProcCode], 
    &#x5B;PriceGrid].&#x5B;Network] AS &#x5B;Network], 
    &#x5B;PriceGrid].&#x5B;AmtClaimedWeighted] AS &#x5B;AmtClaimedWeighted], 
    &#x5B;PriceGrid].&#x5B;ManualPrice] AS &#x5B;ManualPrice], 
    &#x5B;PriceGrid].&#x5B;IsImported] AS &#x5B;IsImported], 
    &#x5B;PriceGrid].&#x5B;DiffCalculatedRate] AS &#x5B;DiffCalculatedRate], 
    &#x5B;PriceGrid].&#x5B;AmtContract] AS &#x5B;AmtContract], 
    &#x5B;PriceGrid].&#x5B;AvgAmtClaimed] AS &#x5B;AvgAmtClaimed], 
    &#x5B;PriceGrid].&#x5B;ProviderName] AS &#x5B;ProviderName], 
    &#x5B;PriceGrid].&#x5B;ClinicName] AS &#x5B;ClinicName]
    FROM &#x5B;dbo].&#x5B;PriceGrid] AS &#x5B;PriceGrid]) AS &#x5B;Extent1]
        WHERE (&#x5B;Extent1].&#x5B;NatureProcCode] = @p__linq__0) AND (&#x5B;Extent1].&#x5B;AvgAmtClaimed] &gt; @p__linq__1)
    )  AS &#x5B;Project1]
    ORDER BY &#x5B;Project1].&#x5B;ProviderName] DESC, &#x5B;Project1].&#x5B;AmtClaimedWeighted] ASC, &#x5B;Project1].&#x5B;AmtContract] ASC, &#x5B;Project1].&#x5B;Approved] ASC, &#x5B;Project1].&#x5B;AvgAmtClaimed] ASC, &#x5B;Project1].&#x5B;ClinicName] ASC, &#x5B;Project1].&#x5B;DiffCalculatedRate] ASC, &#x5B;Project1].&#x5B;DiffWeightedRate] ASC, &#x5B;Project1].&#x5B;GroupProcCode] ASC, &#x5B;Project1].&#x5B;IsImported] ASC, &#x5B;Project1].&#x5B;ManualPrice] ASC, &#x5B;Project1].&#x5B;NatureProcCode] ASC, &#x5B;Project1].&#x5B;Network] ASC, &#x5B;Project1].&#x5B;PracticeSeq] ASC, &#x5B;Project1].&#x5B;SubmitPrvId] ASC
    OFFSET @p__linq__2 ROWS FETCH NEXT @p__linq__3 ROWS ONLY  option (Recompile)',N'@p__linq__0 varchar(8000),@p__linq__1 decimal(2,0),@p__linq__2 int,@p__linq__3 int',@p__linq__0='exames',@p__linq__1=10,@p__linq__2=40,@p__linq__3=20
</pre>
<ul>
<li>It&#8217;s user-friendly and reliable because users can filter the data as if they were using an excel file on steroids</li>
<li>It avoids conflicts because we only get a subset of the results each time and each change is commited in a single transaction</li>
</ul>
<h2>Code samples:</h2>
<p>&nbsp;</p>
<pre class="brush: jscript; title: grid setup; notranslate">
grid = $(&quot;#grid&quot;).kendoGrid({
                dataSource: new kendo.data.DataSource({
                    transport: transport,
                    schema: schema,
                    serverFiltering: true,
                    serverPaging: true,
                    serverSorting: true,
                    type: &quot;odata&quot;,
                    pageSize: 20
                }),
                dataBound: onDataBound,
                pageable: true,
                filterable: true,
                sortable: true,
                scrollable: false,
                navigatable: true,
                resizable: true,
                batch: true,
                columnMenu: true,
                editable: true,
                toolbar: &#x5B;
					{ template: '&lt;a class=&quot;k-button k-button-icontext k-grid-save-batch&quot; href=&quot;\\#&quot;&quot;&gt;&lt;span class=&quot;k-icon k-i-update&quot;&gt;&lt;/span&gt;Guardar Alterações&lt;/a&gt;' },
					{ name: &quot;cancel&quot;, text: &quot;Cancelar&quot; },
                ],
                columns: &#x5B;...]
            });
</pre>
<p>&nbsp;</p>
<pre class="brush: csharp; title: WebAPI; notranslate">
&#x5B;HttpGet]
        public IHttpActionResult Read(ODataQueryOptions&lt;PriceGrid&gt; opts)
        {
            Mapper.CreateMap&lt;PriceGrid, PriceGridBO&gt;();

            using (var context = new EntitiesContext())
            {
                using (var qh = new HintScope(context, QueryHintType.Recompile))
                {
                    List&lt;PriceGrid&gt; results = opts
                        .ApplyTo(context.PriceGrids)
                        .Cast&lt;PriceGrid&gt;()
                        .ToList();

                    List&lt;PriceGridBO&gt; boEntities = results.Select(x =&gt; Mapper.Map&lt;PriceGrid, PriceGridBO&gt;(x)).ToList();

                    PriceResponse response = new PriceResponse()
                    {
                        Entities = boEntities,
                        Total = Request.ODataProperties().TotalCount.HasValue ? Request.ODataProperties().TotalCount.Value : 0
                    };

                    return Ok(response);
                }
            }
        }
</pre>
<p>The post <a href="https://blogit.create.pt/andresantos/2017/07/05/kendoui-grid-odata-webapi-and-entity-framework/">KendoUI Grid, OData, WebAPI and Entity Framework</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2017/07/05/kendoui-grid-odata-webapi-and-entity-framework/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>First ever Lisbon Umbraco Meetup!</title>
		<link>https://blogit.create.pt/andresantos/2016/11/21/first-ever-lisbon-umbraco-meetup/</link>
					<comments>https://blogit.create.pt/andresantos/2016/11/21/first-ever-lisbon-umbraco-meetup/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Mon, 21 Nov 2016 10:26:33 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[Meetup]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/andresantos/?p=1631</guid>

					<description><![CDATA[<p>The first ever Umbraco Meetup in Portugal is going to be held this Thursday at Create IT offices in Lisbon. The event filled up fast which leads me to believe that Umbraco is getting recognized as one of the best CMS&#8217;s to work with. We&#8217;ll try to record some of it, and share it on [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/11/21/first-ever-lisbon-umbraco-meetup/">First ever Lisbon Umbraco Meetup!</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The first ever Umbraco Meetup in Portugal is going to be held this Thursday at Create IT offices in Lisbon. The event filled up fast which leads me to believe that Umbraco is getting <em>recognized</em> as one of the best CMS&#8217;s to work with.</p>
<p>We&#8217;ll try to record some of it, and share it on youtube!</p>
<style type="text/css">#meetup_oembed .mu_clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }* html #meetup_oembed .mu_clearfix, *:first-child+html #meetup_oembed .mu_clearfix { zoom: 1; }#meetup_oembed { background:#eee;border:1px solid #ccc;padding:10px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;margin:0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; }#meetup_oembed h3 { font-weight:normal; margin:0 0 10px; padding:0; line-height:26px; font-family:Georgia,Palatino,serif; font-size:24px }#meetup_oembed p { margin: 0 0 10px; padding:0; line-height:16px; }#meetup_oembed img { border:none; margin:0; padding:0; }#meetup_oembed a, #meetup_oembed a:visited, #meetup_oembed a:link { color: #1B76B3; text-decoration: none; cursor: hand; cursor: pointer; }#meetup_oembed a:hover { color: #1B76B3; text-decoration: underline; }#meetup_oembed a.mu_button { font-size:14px; -moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:2px solid #A7241D;color:white!important;text-decoration:none;background-color: #CA3E47; background-image: -moz-linear-gradient(top, #ca3e47, #a8252e); background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #a8252e), color-stop(1, #ca3e47));disvplay:inline-block;padding:5px 10px; }#meetup_oembed a.mu_button:hover { color: #fff!important; text-decoration: none; }#meetup_oembed .photo { width:50px; height:50px; overflow:hidden;background:#ccc;float:left;margin:0 5px 0 0;text-align:center;padding:1px; }#meetup_oembed .photo img { height:50px }#meetup_oembed .number { font-size:18px; }#meetup_oembed .thing { text-transform: uppercase; color: #555; }</style>
<div id="meetup_oembed" style="height:163px">
<div style="overflow:hidden;max-height:123px">
<h3>Lisbon Umbraco Meetup</h3>
<p style="margin:0 0 10px;font-size:12px;line-height:16px;">Lisbon, PT <br />          <span style="font-size:14px;font-weight:bold;">105</span> <em>Members</em></p>
<p style="line-height:16px">The Lisbon Umbraco Meetup is a networking group for anyone interested in Umbraco. We&#8217;re planning on having at least one formal presentation followed by some lively debates or &#8230;</p>
</p></div>
<p style="margin:10px 0 5px;"><a href="https://www.meetup.com/Lisbon-Umbraco-Meetup/" target="_blank" class="mu_button">Check out this Meetup Group &rarr;</a></p>
</div>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/11/21/first-ever-lisbon-umbraco-meetup/">First ever Lisbon Umbraco Meetup!</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2016/11/21/first-ever-lisbon-umbraco-meetup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Umbraco and Donut Output Cache</title>
		<link>https://blogit.create.pt/andresantos/2016/06/30/umbraco-and-donut-output-cache/</link>
					<comments>https://blogit.create.pt/andresantos/2016/06/30/umbraco-and-donut-output-cache/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Thu, 30 Jun 2016 14:22:01 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[Devtrends]]></category>
		<category><![CDATA[Donut Output Cache]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[mvc 5]]></category>
		<category><![CDATA[MVCDonutCaching]]></category>
		<category><![CDATA[performance]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/andresantos/?p=1571</guid>

					<description><![CDATA[<p>Donut Output Caching is a type of output caching where certain parts of a web page are not cached. It&#8217;s a simple way of boosting your site performance! ASP.NET doesn&#8217;t provide a native way of donut output caching, so we must resort to a great NuGet package called MVCDonutCaching. You can read all about it here: http://www.devtrends.co.uk/blog/donut-output-caching-in-asp.net-mvc-3. [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/06/30/umbraco-and-donut-output-cache/">Umbraco and Donut Output Cache</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Donut Output Caching is a type of output caching where certain parts of a web page are not cached. It&#8217;s a simple way of boosting your site performance!</p>
<p>ASP.NET doesn&#8217;t provide a native way of donut output caching, so we must resort to a great NuGet package called <a href="https://github.com/moonpyk/mvcdonutcaching">MVCDonutCaching</a>. You can read all about it here: <a href="http://www.devtrends.co.uk/blog/donut-output-caching-in-asp.net-mvc-3">http://www.devtrends.co.uk/blog/donut-output-caching-in-asp.net-mvc-3</a>.</p>
<p>Since Umbraco is built on top of ASP.NET MVC, we can easily use this package on our websites. There are, however, some caveats, because Umbraco doesn&#8217;t use the native MVC routing.</p>
<p>For Umbraco, every page that uses the same document type is processed through the same route, therefore, if we have 100 news articles that use the NewsItem document type, from the moment we open one news article page, every other news item page will display the same information, despite having a different URL!</p>
<p><span id="more-6482"></span></p>
<p>The way to bypass this issue is the following:</p>
<p>Create a Global.cs file that includes the logic to cache a page based on their url and not the document type</p>
<pre class="brush: csharp; title: Global.cs; notranslate">
namespace CreateIT.Web
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Umbraco.Web;

    public class Global : UmbracoApplication
    {
        public override string GetVaryByCustomString(HttpContext context, string custom)
        {
            if (custom.ToLower() == &quot;url&quot;)
            {
                return &quot;url=&quot; + context.Request.Url.AbsoluteUri;
            }

            return base.GetVaryByCustomString(context, custom);
        }
    }
}
</pre>
<p>Then, instruct Umbraco to use this class when launching the UmbracoApplication by changing the Global.asax file:</p>
<pre class="brush: plain; title: Global.asax; notranslate">
&amp;lt;%@ Application Codebehind=&quot;Global.cs&quot; Inherits=&quot;CreateIT.Web.Global&quot; Language=&quot;C#&quot; %&amp;gt;
</pre>
<p>Finally, setup an Output Cache profile in your Web.config:</p>
<pre class="brush: xml; title: Web.config; notranslate">
&amp;lt;system.web&amp;gt;
    (...)
    &amp;lt;caching&amp;gt;
      &amp;lt;outputCacheSettings&amp;gt;
        &amp;lt;outputCacheProfiles&amp;gt;
          &amp;lt;add enabled=&quot;true&quot; name=&quot;CreateIT.Actions&quot; duration=&quot;900&quot; location=&quot;Server&quot; varyByCustom=&quot;url&quot; varyByParam=&quot;*&quot; /&amp;gt;
        &amp;lt;/outputCacheProfiles&amp;gt;
      &amp;lt;/outputCacheSettings&amp;gt;
    &amp;lt;/caching&amp;gt;
&amp;lt;/system.web&amp;gt;
</pre>
<p>And decorate the chosen controllers (that you used to <a href="https://our.umbraco.org/documentation/reference/routing/custom-controllers">hijack the Umbraco routes</a>) with the Donut Output Cache attribute:</p>
<pre class="brush: csharp; title: HomepageController.cs; notranslate">
&#x5B;DonutOutputCache(CacheProfile = &quot;CreateIT.Actions&quot;)]
public class HomepageController : Umbraco.Web.Mvc.RenderMvcController
{
</pre>
<p>If you wish to exclude a certain part of your page from the cache, just create a Surface Controller action that returns a partial view and use the extension method provided by MVCDonutCaching for @Html.Action().</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/06/30/umbraco-and-donut-output-cache/">Umbraco and Donut Output Cache</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2016/06/30/umbraco-and-donut-output-cache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Umbraco profiler</title>
		<link>https://blogit.create.pt/andresantos/2016/06/08/umbraco-profiler/</link>
					<comments>https://blogit.create.pt/andresantos/2016/06/08/umbraco-profiler/#respond</comments>
		
		<dc:creator><![CDATA[André Santos]]></dc:creator>
		<pubDate>Wed, 08 Jun 2016 11:16:45 +0000</pubDate>
				<category><![CDATA[Umbraco]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<guid isPermaLink="false">http://blogit.create.pt/andresantos/?p=1481</guid>

					<description><![CDATA[<p>Quick tip: If you need to find which part of your Umbraco application is slowing the site down, follow these steps: Set the debug property of the compilation section of your Web.config to true: &#60;compilation defaultLanguage=&#8221;c#&#8221; debug=&#8221;true&#8221; batch=&#8221;false&#8221; targetFramework=&#8221;4.5&#8243;&#62; If you&#8217;re using an older version of Umbraco, you also probably need to set the umbracoDebugMode app setting to [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/06/08/umbraco-profiler/">Umbraco profiler</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Quick tip:</p>
<p>If you need to find which part of your Umbraco application is slowing the site down, follow these steps:</p>
<ol>
<li>Set the debug property of the compilation section of your Web.config to <strong>true</strong>: <em>&lt;compilation defaultLanguage=&#8221;c#&#8221; <strong>debug=&#8221;true&#8221;</strong> batch=&#8221;false&#8221; targetFramework=&#8221;4.5&#8243;&gt;</em>
<ul>
<li>If you&#8217;re using an older version of Umbraco, you also probably need to set the umbracoDebugMode app setting to true in the same config file: <em>&lt;add key=&#8221;umbracoDebugMode&#8221; value=&#8221;true&#8221; /&gt;</em></li>
</ul>
</li>
<li>Add the query string <strong>?umbdebug=true</strong> to your Umbraco page URL</li>
<li>Thats it!</li>
</ol>
<figure id="attachment_1491" aria-describedby="caption-attachment-1491" style="width: 543px" class="wp-caption alignnone"><a href="http://blogit-create.com/wp-content/uploads/2016/06/profiler.png"><img decoding="async" class="size-full wp-image-1491" src="http://blogit-create.com/wp-content/uploads/2016/06/profiler.png" alt="umbraco profiler" width="543" height="472" srcset="https://blogit.create.pt/wp-content/uploads/2016/06/profiler.png 543w, https://blogit.create.pt/wp-content/uploads/2016/06/profiler-300x261.png 300w, https://blogit.create.pt/wp-content/uploads/2016/06/profiler-483x420.png 483w" sizes="(max-width: 543px) 100vw, 543px" /></a><figcaption id="caption-attachment-1491" class="wp-caption-text">umbraco profiler</figcaption></figure>
<p>It uses <a href="http://miniprofiler.com/">Mini Profiler</a>, so you can add your own profile stops, but out-of-the-box it already analyses the time it takes to render each view.</p>
<p>Happy profiling!</p>
<p>The post <a href="https://blogit.create.pt/andresantos/2016/06/08/umbraco-profiler/">Umbraco profiler</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andresantos/2016/06/08/umbraco-profiler/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
