Skip to content

Instantly share code, notes, and snippets.

@lindstromhenrik
lindstromhenrik / gist:4654694
Created Jan 28, 2013
Excluding CultureInfo from the type of nested object.
View gist:4654694
// NestedFieldNameConvention
// we want to nest only lists of objects not previously mapped to a specific type by EPiServer Find
if ((type.GetGenericTypeDefinition() == typeof(IEnumerable<>))
&& !(type.GetGenericArguments()[0].IsValueType || type.GetGenericArguments()[0] == typeof(string) || type.GetGenericArguments()[0] == typeof(DateTime) || type.GetGenericArguments()[0] == typeof(CultureInfo))
&& !fieldName.Contains("$$")
&& !fieldName.StartsWith("__"))
{
fieldName += "$$nested";
}
@lindstromhenrik
lindstromhenrik / gist:4564976
Created Jan 18, 2013
Filtering on a GeoLocation dictionary with Dictionary2Find
View gist:4564976
public class DictionariesWithGeolocation
{
[Fact]
public void FilterByValueInDictionary()
{
new Story("Filter by matching a key/geolocation in a dictionary")
.InOrderTo("be able to filter on a geolocation of a specific key in a dictionary")
.AsA("developer")
.IWant("to be able to map dictionaries to their correct value type")
.WithScenario("map dictionaries to their correct value type")