public async Task <List <InvoiceLineViewModel> > GetInvoiceLineByTrackIdAsync(int id,
                                                                                      CancellationToken ct = default(CancellationToken))
        {
            var invoiceLines = await _invoiceLineRepository.GetByTrackIdAsync(id, ct);

            return(InvoiceLineCoverter.ConvertList(invoiceLines).ToList());
        }
        public async Task <List <InvoiceLineViewModel> > GetAllInvoiceLineAsync(
            CancellationToken ct = default(CancellationToken))
        {
            var invoiceLines = InvoiceLineCoverter.ConvertList(await _invoiceLineRepository.GetAllAsync(ct));

            return(invoiceLines);
        }
Example #3
0
        public async Task <InvoiceLineViewModel> GetInvoiceLineByIdAsync(int id, CancellationToken ct = default(CancellationToken))
        {
            var invoiceLineViewModel = InvoiceLineCoverter.Convert(await _invoiceLineRepository.GetByIdAsync(id, ct));

            invoiceLineViewModel.Track = await GetTrackByIdAsync(invoiceLineViewModel.TrackId, ct);

            invoiceLineViewModel.Invoice = await GetInvoiceByIdAsync(invoiceLineViewModel.InvoiceId, ct);

            invoiceLineViewModel.TrackName = invoiceLineViewModel.Track.Name;
            return(invoiceLineViewModel);
        }
Example #4
0
        public async Task <List <InvoiceLineViewModel> > GetAllInvoiceLineAsync(CancellationToken ct = default(CancellationToken))
        {
            var invoiceLines = InvoiceLineCoverter.ConvertList(await _invoiceLineRepository.GetAllAsync(ct));

            /*foreach (var invoiceLine in invoiceLines)
             * {
             *  invoiceLine.Track = await GetTrackByIdAsync(invoiceLine.TrackId, ct);
             *  invoiceLine.Invoice = await GetInvoiceByIdAsync(invoiceLine.InvoiceId, ct);
             *  invoiceLine.TrackName = invoiceLine.Track.Name;
             * }*/
            return(invoiceLines.ToList());
        }