Esempio n. 1
0
    public MyDataCashflowDto MapToMyDataCashflowDto(CashflowEntity entity)
    {
        var dto = new MyDataCashflowDto
        {
            Id            = entity.Id,
            Amount        = entity.Amount,
            Description   = entity.Description,
            EffectiveDate = entity.EffectiveDate,
            Frequency     = entity.Frequency,
            IntervalType  = entity.IntervalType,
            Recurrence    = entity.Recurrence,
            Tags          = _tagsMapper.Map(entity.Tags).ToArray(),
            AccountId     = entity.AccountId,
            CategoryId    = entity.CategoryId,
            Inactive      = entity.Inactive
        };

        return(dto);
    }
Esempio n. 2
0
    public CashflowInfoViewModel MapToDto(CashflowEntity entity)
    {
        var dto = new CashflowInfoViewModel
        {
            Id            = entity.Id,
            Amount        = entity.Amount,
            Description   = entity.Description,
            EffectiveDate = entity.EffectiveDate,
            Frequency     = entity.Frequency,
            IntervalType  = entity.IntervalType,
            Recurrence    = entity.Recurrence,
            Inactive      = entity.Inactive,
            Tags          = _tagsMapper.Map(entity.Tags).ToImmutableArray(),
            Account       = _accountMapper.MapToAccountInfoViewModel(entity.Account),
            Category      = _categoryMapper.MapToCategoryInfoViewModel(entity.Category)
        };

        return(dto);
    }
Esempio n. 3
0
    public CashflowEntity MapToEntity(Cashflow model)
    {
        var entity = new CashflowEntity
        {
            Id            = model.Id,
            AccountId     = model.AccountId,
            Amount        = model.Amount,
            CategoryId    = model.CategoryId,
            Description   = model.Description,
            EffectiveDate = model.EffectiveDate,
            Frequency     = model.Frequency,
            Inactive      = model.Inactive,
            IntervalType  = model.IntervalType,
            Recurrence    = model.Recurrence,
            Tags          = _tagsMapper.Map(model.Tags),
            UserId        = model.UserId
        };

        return(entity);
    }