Error executing template "/Designs/isabella/Paragraph/SalesInvoiceOverview.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at CompiledRazorTemplates.Dynamic.RazorEngine_bf1609085d7d4c0e8e96659bb6bcbac2.Execute() in D:\dynamicweb.net\Solutions\isabella.espresso4.dk\files\Templates\Designs\isabella\Paragraph\SalesInvoiceOverview.cshtml:line 22
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.Module @using Co3.Isabella.Data.DAL.Models.AX; @{ IEnumerable<SalesInvoice> invoices = Co3.Isabella.Dw.Services.OrderService.Instance.GetSalesInvoicesByUser(); } @inherits Dynamicweb.Rendering.RazorTemplateBase< Dynamicweb.Rendering.RazorTemplateModel< Dynamicweb.Rendering.Template > > @using Co3.Espresso.Website.Services @using Co3.Espresso.Base.Extensions @using System.Web <div class="card mx-auto w-100"> <div class="card-header"> <h4 class="align-items-center card-title d-flex justify-content-between"> <span class="text-nowrap"> <i class="material-icons material-icons-large">view_list</i> <span>@Translate( "CostumerCenter - My invoices - Heading", "My invoices" )</span> <span class="font-weight-normal text-muted"> (@invoices.Count().ToString())</span> </span> </h4> </div> <div class="card-body"> @if (invoices != null && invoices.Any()){ <div class="table-responsive"> <table class="table"> <thead class="thead-light"> <tr> <th scope="col">@Translate( "CostumerCenter - My invoices - ORDERACCOUNT", "ORDERACCOUNT" )</th> <th scope="col">@Translate( "CostumerCenter - My invoices - INVOICEID", "INVOICEID" )</th> <th scope="col">@Translate( "CostumerCenter - My invoices - INVOICEDATE", "INVOICEDATE" )</th> <th scope="col">@Translate( "CostumerCenter - My invoices INVOICEAMOUNT", "INVOICEAMOUNT" )</th> <th scope="col">@Translate( "CostumerCenter - My invoices CURRENCY", "CURRENCY" )</th> </tr> </thead> <tbody> @foreach (SalesInvoice invoice in invoices) { <tr> <td>@invoice.ORDERACCOUNT</td> <td>@invoice.INVOICEID</td> <td>@invoice.INVOICEDATE.ToShortEspressoFormat()</td> <td>@invoice.INVOICEAMOUNT.ToString("N")</td> <td>@invoice.CURRENCY</td> </tr> } </tbody> </table> </div> } else { <p class="text-muted">@Translate( "CostumerCenter - My orders - No orders to show - Text", "[none]" )</p> } </div> </div>
keyboard_arrow_up