Пример #1
0
        public Task <IEnumerable <SecurityMarket> > GetAll()
        {
            const string sql = @"SELECT Name, Id
                                 FROM cpty.CustomSecurityMarkets";

            return(DbConnectionManager.InvokeOnConnection(ConnectionName.Db1, ConnectionIntent.ReadWrite,
                                                          connection => connection.QueryAsync <SecurityMarket>(sql)));
        }
Пример #2
0
 public Task <IEnumerable <Currency> > GetAll()
 {
     return(CacheService.GetOrAdd("all", () =>
     {
         const string sql = @"SELECT Id, Name
                          FROM cpty.CustomCashMarkets";
         return DbConnectionManager.InvokeOnConnection(ConnectionName.Db1,
                                                       ConnectionIntent.ReadOnly,
                                                       connection => connection.QueryAsync <Currency>(sql));
     }));
 }