public TVal Load <TVal>(TKey id) where TVal : class { var result = QueryFor <TVal> .For(_connection, string.Format("SELECT [Data] from {0} where Id = @id", SqlDoc.tableName <TVal>()), new Dictionary <string, object> { { "id", id } }); return(result.First()); }
public static void Commit <TKey>(IConnection connection, Queue <Operation <TKey> > uow) { var store = ConnectionToStore(connection); SqlDoc.commit(store, QueueToFSharpList(uow)); }
private static T[] For(SqlDoc.Store store, string sql, Dictionary <string, object> parameters = null) { parameters = parameters ?? new Dictionary <string, object>(); return(SqlDoc.select <T>(store, sql, DictionaryToListOfTuples(parameters))); }