Exemplo n.º 1
0
        public static ClientViewModel MapToViewModel(Client client, IEnumerable <Order> orders, IEnumerable <Invoice> invoices)
        {
            var mappedOrders   = OrderMapper.MapManyToViewModel(orders);
            var mappedInvoices = InvoiceMapper.MapManyToViewModel(invoices);

            return(new ClientViewModel()
            {
                Id = client.Id,
                City = client.City,
                Email = client.Email,
                Name = client.Name,
                NIP = client.NIP,
                PESEL = client.PESEL,
                PhoneNumber = client.PhoneNumber,
                PostalCode = client.PostalCode,
                REGON = client.REGON,
                Street = client.Street,
                Invoices = mappedInvoices,
                Orders = mappedOrders
            });
        }