Skip to content

Commit 5384f5c

Browse files
committed
first version
1 parent 34ae4db commit 5384f5c

11 files changed

Lines changed: 79 additions & 9 deletions

File tree

v2/GeneratorData/Category.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ public enum Category
4747
MCP= 42,
4848
Bool=43,
4949
Profiler=44,
50+
Idempotency=45
5051
}
5152

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,5 +1521,10 @@
15211521
"Category": 4,
15221522
"dtStart": "2025-12-18T00:00:00",
15231523
"show": true
1524+
},
1525+
{
1526+
"ID":"RSCG_idempotency",
1527+
"Category":45,
1528+
"dtStart":"2026-01-28T00:00:00"
15241529
}
15251530
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"RSCG_idempotency",
4+
"nuget":[
5+
"https://www.nuget.org/packages/RSCG_idempotency/"
6+
],
7+
"link":"https://github.com/ignatandrei/RSCG_idempotency",
8+
"author":"Ignat Andrei",
9+
"source":"https://github.com/ignatandrei/RSCG_idempotency"
10+
},
11+
"data":{
12+
"goodFor":["Generating code for idempotency"],
13+
"csprojDemo":"IdempotencyDemo.csproj",
14+
"csFiles":["Program.cs","Purchase.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="IdempotencyDemo/IdempotencyDemo.csproj" />
3+
</Solution>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="Microsoft.Extensions.Caching.Memory" Version="10.0.2" />
12+
<PackageReference Include="RSCG_idempotency" Version="10.2026.127.2000" />
13+
</ItemGroup>
14+
<PropertyGroup>
15+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
16+
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
17+
</PropertyGroup>
18+
19+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// See https://aka.ms/new-console-template for more information
2+
using IdempotencyDemo;
3+
4+
Console.WriteLine("Hello, World!");
5+
Purchase p= new Purchase();
6+
var uniq = Guid.NewGuid().ToString("D");
7+
var s= p.PurchaseNow(uniq, "Book1", 20);
8+
Console.WriteLine(s);
9+
s = p.PurchaseNow(uniq, "Book1", 20);
10+
Console.WriteLine(s);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace IdempotencyDemo;
6+
7+
internal partial class Purchase
8+
{
9+
public bool PurchaseNow([RSCG_IdemPotency.Idempotent]string UniqueId, string idProduct,int quantity)
10+
{
11+
if(PurchaseNow_ExistsBefore(UniqueId))
12+
return false;
13+
14+
Console.WriteLine($"bought ! ");
15+
return true;
16+
}
17+
}

v2/rscg_examples_site/docs/Authors/AndreiIgnat.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

v2/rscg_examples_site/docs/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: About
66
## Content
77

88
You will find here code examples
9-
of 251 Roslyn Source Code Generator (RSCG)
9+
of 252 Roslyn Source Code Generator (RSCG)
1010
that can be useful for you. That means, you will write more elegant and concise code - even if the generators code is not always nice to look.
1111

1212
## Are those examples ready for production?

v2/rscg_examples_site/src/components/HomepageFeatures/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styles from './styles.module.css';
44

55
const FeatureList = [
66
{
7-
title: '251 Examples (16 from MSFT)',
7+
title: '252 Examples (16 from MSFT)',
88
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
99
description: (
1010
<>

0 commit comments

Comments
 (0)