Files
oqtane.framework/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Startup/ClientStartup.cs
Leigh Pointer 60b2e50511 Rename services to Client/Server and update refs
Rename the client service class/file from [Module]Service to Client[Module]Service and the server service to Server[Module]Service. Update Edit.razor and Index.razor to inject Client[Module]Service and adjust all calls accordingly. Update DI registration in ClientStartup to register Client[Module]Service. Also remove the System.Net.Http.Json package reference from the client .csproj. File renames and reference updates keep class names and registrations consistent between client and server templates.
2026-02-06 18:25:21 +01:00

19 lines
510 B
C#

using Microsoft.Extensions.DependencyInjection;
using System.Linq;
using Oqtane.Services;
using [Owner].Module.[Module].Services;
namespace [Owner].Module.[Module].Startup
{
public class ClientStartup : IClientStartup
{
public void ConfigureServices(IServiceCollection services)
{
if (!services.Any(s => s.ServiceType == typeof(I[Module]Service)))
{
services.AddScoped<I[Module]Service, Client[Module]Service>();
}
}
}
}