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)); }
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]); }
public MemberProfileViewModel Get(string id) { var account = RavenSession.Load <Account>(Account.SanitizeId(id)); return(MemberProfileViewModel.FromAccount(account, _transactionService.GetBalance(account.Id))); }