public String AddWalletToUserApi(Guid id) { User u = DataAccessAction.user.GetUserById(id); UserModel us = new UserModel { Id = u.Id, Username = u.Username }; List <WalletModel> wallets = new List <WalletModel>(); foreach (var item in DataAccessAction.wallet.GetWalletNotInUserScope(id)) { wallets.Add(new WalletModel { Id = item.Id, Service = item.Service }); } AddWalletToUserContentModel acm = new AddWalletToUserContentModel { User = us, Wallets = wallets }; return(JsonConvert.SerializeObject(acm)); }
public ActionResult AddWalletToUserExtend(Guid id) { User u = DataAccessAction.user.GetUserById(id); UserModel us = new UserModel { Id = u.Id, Username = u.Username }; List <WalletModel> wallets = new List <WalletModel>(); foreach (var item in DataAccessAction.wallet.GetWalletNotInUserScope(id)) { wallets.Add(new WalletModel { Id = item.Id, Service = item.Service }); } AddWalletToUserContentModel acm = new AddWalletToUserContentModel { User = us, Wallets = wallets }; return(View(acm)); }