File tree Expand file tree Collapse file tree 5 files changed +47
-4
lines changed
Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments