21 lines
838 B
C#
21 lines
838 B
C#
using System.Globalization;
|
|
using CsvHelper.Configuration;
|
|
using ExpenseTracker.Application.Common.Extensions;
|
|
using ExpenseTracker.Application.Transactions;
|
|
|
|
namespace ExpenseTracker.Application.Accounts;
|
|
|
|
public class TransactionCsvMap : ClassMap<TransactionDto>
|
|
{
|
|
public TransactionCsvMap()
|
|
{
|
|
AutoMap(CultureInfo.InvariantCulture);
|
|
Map(e => e.Id).Ignore();
|
|
Map(e => e.Amount).Name(nameof(TransactionDto.Amount).ToString().FirstCharacterToLower());
|
|
Map(e => e.Category).Name(nameof(TransactionDto.Category).ToString().FirstCharacterToLower());
|
|
Map(e => e.Time).Name(nameof(TransactionDto.Time).ToString().FirstCharacterToLower());
|
|
Map(e => e.Description).Name(nameof(TransactionDto.Description).ToString().FirstCharacterToLower());
|
|
Map(e => e.AccountId).Ignore();
|
|
}
|
|
}
|