Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public static void Commit <TKey>(IConnection connection, Queue <Operation <TKey> > uow)
        {
            var store = ConnectionToStore(connection);

            SqlDoc.commit(store, QueueToFSharpList(uow));
        }
Esempio n. 3
0
 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)));
 }