egonl / SharpDocx

Lightweight template engine for creating Word documents
MIT License
333 stars 76 forks source link

Support for Linq #76

Open atlaste opened 2 months ago

atlaste commented 2 months ago

I have a pretty simple feature request: support linq. Basically add the 'using System.Linq' at the top of the generated code and link in the System.Data.Linq.dll.

egonl commented 2 months ago

Did you try the Assembly and Import directives?

atlaste commented 1 month ago

Sorry for the late reply. Yes, I did that:

Document contains:

<%@ Assembly Name="System.Data.Linq" %>
<%@ Import Namespace="System.Linq" %>

Line 6: error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)