Beispiel #1
0
        /// <summary>
        /// Converts this instance of <see cref="AccountDTO"/> to an instance of <see cref="Account"/>.
        /// </summary>
        /// <param name="dto"><see cref="AccountDTO"/> to convert.</param>
        public static Account ToEntity(this AccountDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new Account();

            entity.AccountID     = dto.AccountID;
            entity.Balance       = dto.Balance;
            entity.Currency      = dto.Currency;
            entity.TypeOfAccount = dto.TypeOfAccount;

            dto.OnEntity(entity);

            return(entity);
        }