Skip to content

Commit

Permalink
Change generated namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
smithgeek committed Nov 2, 2024
1 parent 3193be8 commit 75ca239
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Voyager.SourceGenerator/VoyagerSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ internal string Emit(IEnumerable<EndpointClass> endpointClasses, Compilation com
.AddUsing("System.ComponentModel.DataAnnotations")
.AddUsing("Microsoft.Extensions.DependencyInjection.Extensions");

var voyagerGenNs = source.AddNamespace($"Voyager.Generated.{compilation.AssemblyName}");
var generatedNamespace = $"Voyager.Generated.Assemblies.g{compilation.AssemblyName}";
var voyagerGenNs = source.AddNamespace(generatedNamespace);
var servicesMethod = source.AddNamespace("Microsoft.Extensions.DependencyInjection")
.AddClass(new($"VoyagerEndpoints{debugSuffix}", Access.Internal, isStatic: true))
.AddMethod(new($"AddVoyager{debugSuffix}", access: Access.Internal, isStatic: true))
Expand Down Expand Up @@ -308,7 +309,7 @@ internal string Emit(IEnumerable<EndpointClass> endpointClasses, Compilation com
}
}

servicesMethod.AddStatement($"services.AddTransient<IVoyagerMapping, Voyager.Generated.{compilation.AssemblyName}.EndpointMapper{debugSuffix}>();");
servicesMethod.AddStatement($"services.AddTransient<IVoyagerMapping, {generatedNamespace}.EndpointMapper{debugSuffix}>();");

return source.Build();
}
Expand Down

0 comments on commit 75ca239

Please sign in to comment.