Skip to content

Commit afb6ae3

Browse files
committed
example
1 parent b926cf0 commit afb6ae3

7 files changed

Lines changed: 95 additions & 10 deletions

File tree

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,5 +1527,12 @@
15271527
"Category":45,
15281528
"dtStart":"2026-01-28T00:00:00",
15291529
"show":true
1530+
},
1531+
{
1532+
1533+
"ID":"FastCloner",
1534+
"Category":29,
1535+
"dtStart":"2026-02-01T00:00:00",
1536+
"show":true
15301537
}
15311538
]

v2/RSCGExamplesData/NoExample.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -997,16 +997,6 @@
997997
"name":"https://github.com/sebastienros/comptime",
998998
"why":"later"
999999
},
1000-
{
1001-
"ID":254,
1002-
"name":"https://github.com/skarllot/EnumUtilities",
1003-
"why":"later"
1004-
},
1005-
{
1006-
"ID":255,
1007-
"name":"https://github.com/lofcz/FastCloner/",
1008-
"why":"later"
1009-
},
10101000
{"ID":256,
10111001
"name":"https://github.com/ANcpLua/ErrorOrX",
10121002
"why":"later"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"FastCloner",
4+
"nuget":[
5+
"https://www.nuget.org/packages/FastCloner/"
6+
],
7+
"link":"https://github.com/lofcz/FastCloner/",
8+
"author":"Matěj Štágl",
9+
"source":"https://github.com/lofcz/FastCloner/"
10+
},
11+
"data":{
12+
"goodFor":["Cloning objects"],
13+
"csprojDemo":"CloneData.csproj",
14+
"csFiles":["Program.cs","Person.cs"],
15+
"excludeDirectoryGenerated":[""],
16+
"includeAdditionalFiles":[""]
17+
},
18+
"links":{
19+
"blog":"",
20+
"video":""
21+
}
22+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35507.96 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CloneData", "CloneData\CloneData.csproj", "{CA3E929D-2578-48A5-B098-13A7B4D81D03}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{CA3E929D-2578-48A5-B098-13A7B4D81D03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{CA3E929D-2578-48A5-B098-13A7B4D81D03}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{CA3E929D-2578-48A5-B098-13A7B4D81D03}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{CA3E929D-2578-48A5-B098-13A7B4D81D03}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {324EECCB-2C9E-452F-84B0-CCCD40DAA208}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
<PropertyGroup>
10+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
11+
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
12+
</PropertyGroup>
13+
<ItemGroup>
14+
<PackageReference Include="FastCloner" Version="3.4.4" />
15+
<PackageReference Include="FastCloner.SourceGenerator" Version="1.1.4" />
16+
</ItemGroup>
17+
18+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+

2+
using FastCloner.SourceGenerator.Shared;
3+
4+
namespace CloneData;
5+
[FastClonerClonable]
6+
public partial class Person
7+
{
8+
public string FirstName { get; set; } = "";
9+
public string LastName { get; set; } = "";
10+
public int Age { get; set; }
11+
public string Name() => $"{FirstName} {LastName}";
12+
13+
public Person[] Childs { get; set; } = [];
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using CloneData;
2+
3+
Console.WriteLine("Hello, World!");
4+
Person p = new ();
5+
p.FirstName = "Andrei";
6+
p.LastName = "Ignat";
7+
p.Age = 54;
8+
var p1=p.FastDeepClone();
9+
Console.WriteLine(p1.Name());

0 commit comments

Comments
 (0)