This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON: | |
{"StructureId":"45748284fbfce011910a544249037e42","Names":{"First":"Daniel","Last":"Wertheim"},"Values":{"Value":{"Is":99},"Guid":"19adfa6da12748e09291aeb75e8ca23c","Int":42,"Long":142,"String":"String in ValuesContainer.","Double":1.33,"Decimal":3.14,"Bool":true},"NullValuesContainer":{"Guid":"60d977f995fc40fd9a7e6827e920370f","Int":42,"Long":142,"String":"String in NullValuesContainer.","Double":1.33,"Decimal":3.14,"Bool":true},"NullValuesContainerWithNulls":{},"ValuesInArray":[{"Is":1},{"Is":2},{"Is":3}],"ValuesInIList":[{"Is":31},{"Is":32},{"Is":33}],"ValuesInList":[{"Is":41},{"Is":42},{"Is":43}],"ValuesInISet":[{"Is":11},{"Is":12},{"Is":13}],"ValuesInHashSet":[{"Is":21},{"Is":22},{"Is":23}]} | |
NOTE! ValuesInIList is deserialized to member but ValuesInISet is not. | |
public class MyClass | |
{ | |
public MyClass() {} | |
... ... ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IDbDataTypeTranslator | |
{ | |
string ToDbType(IIndexAccessor indexAccessor); | |
string ToDbType(Type dataType); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- C# Predicate: item.SortOrder == 2 || (item.SortOrder == 1 && item.StringValue == "B").Take(2).SortBy(item => item.StringValue) | |
-- Existing rows | |
-- {"StructureId":"208fad84b608e111b21c544249037e42","SortOrder":2,"StringValue":"D"} | |
-- {"StructureId":"218fad84b608e111b21c544249037e42","SortOrder":2,"StringValue":"C"} | |
-- {"StructureId":"228fad84b608e111b21c544249037e42","SortOrder":1,"StringValue":"B"} | |
-- {"StructureId":"238fad84b608e111b21c544249037e42","SortOrder":1,"StringValue":"A"} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AssemblyInitializer : IAssemblyContext | |
{ | |
private static bool _isInitialized; | |
public void OnAssemblyStart() | |
{ | |
if (_isInitialized) | |
return; | |
_isInitialized = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#v0.12 | |
# Dev stuff | |
[Aa]pp_[Dd]ata/ | |
[Bb]uild/ | |
[Bb]uilds/ | |
[Oo]bj/ | |
[Bb]in/ | |
[D]ebug/ | |
[Tt]est[Rr]esult/ | |
[Tt]emp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Factory<T> where T : class | |
{ | |
private static readonly Func<T> FactoryFn; | |
static Factory() | |
{ | |
//FactoryFn = CreateUsingActivator(); | |
FactoryFn = CreateUsingLambdas(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content2 is represented as name in the Json, event if it's ToString returns null. Tried SerializeFn to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r = session.Query<Photo>().ToEnumerableOfJson() | |
.Select(s => s.Deserialize(new { Votes = 0, User = "" })) //The call | |
.GroupBy(s => s.User).ToArray(); | |
//Ok, so the problem is that Votes and User doesn't get setters, right? But the have fields. | |
//E.g "<Votes>i__Field" which could be used | |
//Or perhaps the contract could be used to create a typed dictionary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Behavior today. Everything within the Session is treated as ONE atom transaction. | |
using(var session = db.BeginSession()) | |
{ | |
session.Insert(myFoo); | |
session.InsertMany(myBars); | |
session.Update(mySuperFoo); | |
} | |
//Thinking of.... each operation against session is treated as ONE atom operation. | |
using(var session = db.BeginSession()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HandleError] | |
public class WikiController : Controller | |
{ | |
[OutputCache(CacheProfile = "KiwiWikiCache")] | |
public ActionResult Doc(string docId) | |
{ | |
return View(MvcApplication.MarkdownService.GetDocument(docId)); | |
} | |
} |
OlderNewer