Querying EPiServer PageData using LINQ

As I’ve been somewhat involved in the development of the new DynamicDataStore in EPiServer CMS 6 , and especially its LINQ-support, I started to think that much of the same concepts should be able to apply on EPiServer Pages as well to provide a nice LINQ-interface to EPiServer PageData. So, I sat down and ripped out parts of the DDS LINQ-support and rewrote some stuff needed for querying pages/properties, and found out that I could actually quite easily support a bunch of LINQ-features like... [ Read full article ]

08 June 2010  9 Comments


Passing Table Value Parameter to function yields error

In a project I’m currently working with, I added some SQL-code that uses a Table Value Parameter and passes this into a User Defined Function . Here’s a small t-sql showing what I wanted to accomplish: create type MyType as table (     Name varchar(128) ) go create function MyFunction (@Names as MyType readonly) returns int as begin     return (select COUNT(*) from @Names) end go declare @names MyType insert into @names select 'Kalle' union select 'Pelle' select dbo.MyFunction( @names ) This... [ Read full article ]

21 April 2010  2 Comments

Tags:


A stab at the GoogleAnalytics API

This is a first shot at creating a EPiServer CMS module that integrates Google Analytics statistical data using their (Google's) recently published API . The module is released under open source up at Code Resort, https://www.coderesort.com/p/epicode/wiki/GoogleAnalyticsAPI . A prebuilt DLL is also available for download if you just want to play around with it. The module consists of one Edit mode plug-in displaying Page View statistics for selected pages (and their sub-pages) and also two... [ Read full article ]

17 June 2009  6 Comments


A typechanging ToArray()

In my last post, Joining Strings , I showed how a small extension to the IEnumerable<T> type can come in handy to ease the task of joining a string together from an enumerations of complex types. Another little nifty trick is to define a universal ToArray() that lets you convert a list of types into an array of some other type and letting you specify, through the Func<T, TResult> predicate, just how that conversion is to be done. Such an extension would let us write code like this:... [ Read full article ]

12 June 2009  1 Comments


Joining strings

I often face a situation where I want to “join” a string together using some separator, but have an enumeration of complex items. Say for example that I have an array of Contacts, each consisting of a firstname and a lastname, something like this: Contact[] contacts = new Contact[] { new Contact() { FirstName=" Anders ", LastName=" Andersson " }, new Contact() { FirstName=" Bengt ", LastName=" Bengtsson " }, new Contact() { FirstName=" Cedric ", LastName=" Cedricsson " } }; Now say that you... [ Read full article ]

11 June 2009  2 Comments


EPiTrace logger