예제 #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;

            dto.OnEntity(entity);

            return entity;
        }
예제 #2
0
        /// <summary>
        /// Invoked when <see cref="ToEntity"/> operation is about to return.
        /// </summary>
        /// <param name="entity"><see cref="Account"/> converted from <see cref="AccountDTO"/>.</param>
partial         static void OnEntity(this AccountDTO dto, Account entity);