/// <summary> /// Converts this instance of <see cref="Account"/> to an instance of <see cref="AccountDTO"/>. /// </summary> /// <param name="entity"><see cref="Account"/> to convert.</param> public static AccountDTO ToDTO(this Account entity) { if (entity == null) return null; var dto = new AccountDTO(); dto.AccountID = entity.AccountID; dto.Balance = entity.Balance; dto.Currency = entity.Currency; entity.OnDTO(dto); return dto; }
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="AccountDTO"/> converted from <see cref="Account"/>.</param> partial static void OnDTO(this Account entity, AccountDTO dto);