Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
239573049 committed Oct 29, 2024
1 parent 3f87395 commit c6820d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<Version>1.0.6</Version>
<Version>1.0.7</Version>
<Company>AIDotNet</Company>
<Authors>Token</Authors>
<Description>自动依赖注入,利用源生成器实现自动依赖注入,并且不使用反射进行实现功能。</Description>
Expand Down
6 changes: 3 additions & 3 deletions src/Gnarly/ServiceRegistrationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ private void Execute(Compilation compilation, SourceProductionContext context)
// 扫描当前编译单元和所有引用的程序集
ScanService.ScanAndCollect(compilation, scopeMethods, singletonMethods, transientMethods);

var scopeRegistrations = string.Join(" ", scopeMethods.Select(m => $"services.AddScoped<{m}>();"));
var scopeRegistrations = string.Join("\n ", scopeMethods.Select(m => $"services.AddScoped<{m}>();"));
var singletonRegistrations =
string.Join(" ", singletonMethods.Select(m => $"services.AddSingleton<{m}>();"));
string.Join("\n ", singletonMethods.Select(m => $"services.AddSingleton<{m}>();"));
var transientRegistrations =
string.Join(" ", transientMethods.Select(m => $"services.AddTransient<{m}>();"));
string.Join("\n ", transientMethods.Select(m => $"services.AddTransient<{m}>();"));

// 生成源代码
string source = $@"// Gnarly自动生成的源代码,请勿手动修改
Expand Down

0 comments on commit c6820d5

Please sign in to comment.