Skip to content

Instantly share code, notes, and snippets.

@lindstromhenrik
lindstromhenrik / gist:4654694
Created January 28, 2013 11:14
Excluding CultureInfo from the type of nested object.
// 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 January 18, 2013 14:40
Filtering on a GeoLocation dictionary with Dictionary2Find
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")