示例#1
0
        public MemberProfileViewModel GetMemberProfile(string id)
        {
            var account = RavenSession.Query <Account>().FirstOrDefault(x => x.Id == id);
            var balance = _transactionService.GetBalance(account.Id);

            return(MemberProfileViewModel.FromAccount(account, balance));
        }
示例#2
0
        public IEnumerable <MemberProfileViewModel> GetAll()
        {
            var results = new List <Account>(RavenSession.Query <Account>().OrderBy(x => x.Id));

            return(results.Any()
                ? results.Select(x => MemberProfileViewModel.FromAccount(x, _transactionService.GetBalance(x.Id)))
                : new MemberProfileViewModel[0]);
        }
示例#3
0
        public MemberProfileViewModel Get(string id)
        {
            var account = RavenSession.Load <Account>(Account.SanitizeId(id));

            return(MemberProfileViewModel.FromAccount(account, _transactionService.GetBalance(account.Id)));
        }