예제 #1
0
        public async Task <IReadOnlyCollection <User> > GetAll()
        {
            var dataSet = await _executor.ExecuteDataSet("sp_select_all_users");

            var mapper = new Mapper <DataSet, IReadOnlyCollection <User> > {
                MapCollection = UserMapStrategies.MapUserCollection
            };

            return(mapper.MapCollection(dataSet));
        }
예제 #2
0
        public async Task <IReadOnlyCollection <decimal> > GetAll()
        {
            var dataSet = await _executor.ExecuteDataSet(
                "sp_select_expenses_by_user_id",
                new Dictionary <string, object>
            {
                { "userId", SqlConstants.CurrentUserId },
            });

            var mapper = new Mapper <DataSet, IReadOnlyCollection <decimal> > {
                Map = MapStrategy.MapIncomes
            };

            return(mapper.Map(dataSet));
        }