Matthew Alexandros
01/16/2024, 9:11 PMservices.AddScoped<>();
then the @inject
command in the razor page. In my new Umb13 there is no startup.cs, checking with ChatGPT it says I now need to make a custom "Composer" class and inject in there. Is this the correct way now? Here is the code it generated:
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
public class CustomComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddScoped<IMyCustomService, MyCustomService>();
}
}
D_Inventor
01/17/2024, 5:01 AMMatthew Alexandros
01/17/2024, 5:42 AMD_Inventor
01/17/2024, 6:23 AMD_Inventor
01/17/2024, 6:27 AMD_Inventor
01/17/2024, 6:29 AMMatthew Alexandros
01/17/2024, 6:37 AMMatthew Alexandros
01/17/2024, 2:35 PM