Skip to content

Commit 327855c

Browse files
committed
Added separate nuget readme
1 parent 32a856a commit 327855c

File tree

5 files changed

+47
-4
lines changed

5 files changed

+47
-4
lines changed

AutoCtor.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Solution>
22
<Folder Name="/Solution Items/">
33
<File Path="mdsnippets.json" />
4+
<File Path="readme.nuget.md" />
45
<File Path="readme.source.md" />
56
<File Path="src/Common.props" />
67
<File Path="src/Directory.Build.props" />

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ AutoCtor is a Roslyn Source Generator that will automatically create a construct
1616

1717
```diff
1818
+[AutoConstruct]
19-
public partial class AService
19+
+public partial class AService
20+
-public class AService
2021
{
2122
private readonly IDataContext _dataContext;
2223
private readonly IDataService _dataService;

readme.nuget.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AutoCtor
2+
3+
AutoCtor is a Roslyn Source Generator that will automatically create a constructor for your class for use with constructor Dependency Injection.
4+
5+
# How to Use
6+
7+
- Make the class `partial`
8+
- Add `[AutoConstruct]`
9+
- Remove the constructor
10+
11+
```diff
12+
+[AutoConstruct]
13+
+public partial class AService
14+
-public class AService
15+
{
16+
private readonly IDataContext _dataContext;
17+
private readonly IDataService _dataService;
18+
private readonly IExternalService _externalService;
19+
private readonly ICacheService _cacheService;
20+
private readonly ICacheProvider _cacheProvider;
21+
private readonly IUserService _userService;
22+
23+
- public AService(
24+
- IDataContext dataContext,
25+
- IDataService dataService,
26+
- IExternalService externalService,
27+
- ICacheService cacheService,
28+
- ICacheProvider cacheProvider,
29+
- IUserService userService
30+
- )
31+
- {
32+
- _dataContext = dataContext;
33+
- _dataService = dataService;
34+
- _externalService = externalService;
35+
- _cacheService = cacheService;
36+
- _cacheProvider = cacheProvider;
37+
- _userService = userService;
38+
- }
39+
}
40+
```

readme.source.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ AutoCtor is a Roslyn Source Generator that will automatically create a construct
99

1010
```diff
1111
+[AutoConstruct]
12-
public partial class AService
12+
+public partial class AService
13+
-public class AService
1314
{
1415
private readonly IDataContext _dataContext;
1516
private readonly IDataService _dataService;

src/AutoCtor.Attributes/AutoCtor.Attributes.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<None Include="$(ArtifactsPath)\bin\AutoCtor.Roslyn4.4\$(ArtifactsPivots)\AutoCtor.dll"
4343
Pack="true" PackagePath="analyzers/dotnet/roslyn4.4/cs" Visible="false"/>
4444

45-
<None Include="$(ProjectDir)..\..\readme.md"
46-
Pack="true" PackagePath="\" Visible="false" />
45+
<None Include="$(ProjectDir)..\..\readme.nuget.md"
46+
Pack="true" PackagePath="\readme.md" Visible="false" />
4747
<None Include="$(ProjectDir)..\..\src\nugetfiles\AutoCtor.props"
4848
Pack="true" PackagePath="build" Visible="false" />
4949

0 commit comments

Comments
 (0)