コード例 #1
0
        public static Account ToEntity(AccountDTO dto)
        {
            var entity = new Account();

            entity.Active       = dto.Active;
            entity.Balance      = dto.Balance;
            entity.Currency     = dto.Currency;
            entity.Settings     = SettingsConverter.ToEntity(dto.Settings);
            entity.Plan         = PlanConverter.ToEntity(dto.Plan);
            entity.VirtualCards = toVirtualCardsEntity(dto.VirtualCards);
            entity.Transactions = toTransactionHistoryEntity(dto.Transactions);
            return(entity);
        }
コード例 #2
0
        public static AccountDTO ToDTO(Account entity)
        {
            var dto = new AccountDTO();

            dto.Active       = entity.Active;
            dto.Balance      = entity.Balance;
            dto.Currency     = entity.Currency;
            dto.Settings     = SettingsConverter.ToDTO(entity.Settings);
            dto.Plan         = PlanConverter.ToDTO(entity.Plan);
            dto.VirtualCards = toVirtualCardsDTO(entity.VirtualCards);
            dto.Transactions = toTransactionHistoryDTO(entity.Transactions);
            return(dto);
        }