Skip to content

Commit 35351f0

Browse files
authored
Merge pull request #469 from ignatandrei/Maestria.TypeProviders
2 parents 7c330b5 + 5b5a35e commit 35351f0

7 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"Maestria.TypeProviders",
4+
"nuget":[
5+
"https://www.nuget.org/packages/Maestria.TypeProviders/"
6+
],
7+
"link":"https://github.com/MaestriaNet/TypeProviders",
8+
"author":"Fábio Monteiro Naspolini",
9+
"source":"https://github.com/MaestriaNet/TypeProviders"
10+
},
11+
"data":{
12+
"goodFor":["Generating strong typed code from Excel."],
13+
"csprojDemo":"DemoExcel.csproj",
14+
"csFiles":["Program.cs","MyExcelPerson.cs","Person.cs"],
15+
"excludeDirectoryGenerated":[""],
16+
"includeAdditionalFiles":[""]
17+
},
18+
"links":{
19+
"blog":"",
20+
"video":""
21+
}
22+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="DemoExcel/DemoExcel.csproj" />
3+
</Solution>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="ClosedXML" Version="0.105.0" />
12+
<PackageReference Include="Maestria.Extensions" Version="3.7.2.0" />
13+
<PackageReference Include="Maestria.TypeProviders" Version="1.3.1">
14+
<PrivateAssets>all</PrivateAssets>
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
</PackageReference>
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<None Update="MyExcel.xlsx">
21+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22+
</None>
23+
</ItemGroup>
24+
25+
<PropertyGroup>
26+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
27+
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
28+
</PropertyGroup>
29+
</Project>
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace DemoExcel;
2+
3+
public partial class MyExcelPerson
4+
{
5+
public string FullName() => $"{FirstName} {LastName}";
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace DemoExcel;
6+
7+
[ExcelProvider(TemplatePath = @"MyExcel.xlsx")]
8+
public partial class MyExcelPerson
9+
{
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using DemoExcel;
2+
3+
Console.WriteLine("Hello, World!");
4+
var persons = MyExcelPersonFactory.Load("MyExcel.xlsx").ToArray();
5+
6+
foreach (var person in persons)
7+
{
8+
Console.WriteLine(person.ID + person.FullName());
9+
10+
}

0 commit comments

Comments
 (0)