Beispiel #1
0
        // Write a query to get the asset list for the selected user (userId)
        // ordered by the asset’s name.
        // Each record of the output model should include Asset.Id, Asset.Name and Balance.
        public IEnumerable <AssetDto> GetUsersAssets(Guid userId)
        {
            var assets = MoneyManagerContext.Assets
                         .Where(a => a.UserId == userId)
                         .OrderBy(a => a.Name);

            return(AssetMapper.MapToAssetDto(assets));
        }
Beispiel #2
0
        public new AssetDto Get(Guid assetId)
        {
            var asset = base.Get(assetId);

            return(AssetMapper.MapToAssetDto(asset));
        }