Ejemplo n.º 1
0
        public static Task <List <T> > FetchAsync <T>(this AP.Database self, FSharpExpr <FSharpFunc <T, bool> > query)
        {
            var translated = ExpressionToSql.Translate(GetDialect(self).Quoter, query, true, ExtractAsyncPocoColumnNameFs,
                                                       EmptyCustomParameterValue, FSharpOption <Translator.ItemInCollectionImpl> .None);

            return(self.FetchAsync <T>(translated.Item1, translated.Item2));
        }
Ejemplo n.º 2
0
        public static Task <List <T> > FetchAsync <T>(
            this AP.Database self, Translator.ConjunctionWord wrd, params Expression <Func <T, bool> >[] queries)
        {
            var translated = ExpressionToSql.Translate(GetDialect(self).Quoter, wrd, queries, true, ExtractAsyncPocoColumnName);

            return(self.FetchAsync <T>(translated.Item1, translated.Item2));
        }
Ejemplo n.º 3
0
        public async Task <TodoDetails> RequestAsync(DetailsQuery query)
        {
            var todo = await _database.SingleAsync <TodoEntity>(query.Id);

            var assignedTo = await _database.SingleAsync <UserEntity>(todo.AssignedToUserId);

            var details = Mapping.MapTo <TodoDetails>(todo, assignedTo);

            var users = await _database.FetchAsync <AssignedTo>(UserSql);

            details.Users = users.ToList();

            return(details);
        }
Ejemplo n.º 4
0
        public static Task <List <T> > FetchAsync <T>(this AP.Database self, Expression <Func <T, bool> > query)
        {
            var translated = ExpressionToSql.Translate(GetDialect(self).Quoter, query, true, ExtractAsyncPocoColumnName);

            return(self.FetchAsync <T>(translated.Item1, translated.Item2));
        }