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); }
public static Task <T> SingleAsync <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.SingleAsync <T>(translated.Item1, translated.Item2)); }
public static Task <T> SingleAsync <T>(this AP.Database self, Expression <Func <T, bool> > query) { var translated = ExpressionToSql.Translate(GetDialect(self).Quoter, query, true, ExtractAsyncPocoColumnName); return(self.SingleAsync <T>(translated.Item1, translated.Item2)); }