LegendaryDependencyInjection.Extensions.AspNet
1.0.0.3
dotnet add package LegendaryDependencyInjection.Extensions.AspNet --version 1.0.0.3
NuGet\Install-Package LegendaryDependencyInjection.Extensions.AspNet -Version 1.0.0.3
<PackageReference Include="LegendaryDependencyInjection.Extensions.AspNet" Version="1.0.0.3" />
<PackageVersion Include="LegendaryDependencyInjection.Extensions.AspNet" Version="1.0.0.3" />
<PackageReference Include="LegendaryDependencyInjection.Extensions.AspNet" />
paket add LegendaryDependencyInjection.Extensions.AspNet --version 1.0.0.3
#r "nuget: LegendaryDependencyInjection.Extensions.AspNet, 1.0.0.3"
#:package LegendaryDependencyInjection.Extensions.AspNet@1.0.0.3
#addin nuget:?package=LegendaryDependencyInjection.Extensions.AspNet&version=1.0.0.3
#tool nuget:?package=LegendaryDependencyInjection.Extensions.AspNet&version=1.0.0.3
修复pagemodel注入问题
传奇级依赖注入aspnet扩展,controller自动延迟注入
示例代码:
builder.Services.AddMvc().AddJsonOptions(op ⇒ { var opp = op.JsonSerializerOptions; opp.WriteIndented = true; opp.PropertyNamingPolicy = null; opp.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping; }).AddLegendaryDependencyInjector();
public class HomeController : Controller { [Inj] public virtual IEnumerable<ILazyClass> LazyClasses { get; set; } = default!;
private ILazyClass? _defaultLazy { get; set; } = null; [Keyed("def")] public virtual ILazyClass DefaultLazy { get { return _defaultLazy!; } set { _defaultLazy = value; } } [Keyed("fst")] public virtual ILazyClass FirstLazy { get; set; } = default!;
private IDelayFactory<ILazyClass> _delayClass { get; set; } = default!; [Inj] public virtual IServiceProvider Services { get; set; } = default!;
public HomeController(IDelayFactory<ILazyClass> delayClass) { _delayClass = delayClass; } }
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- LegendaryDependencyInjection (>= 1.0.0.3)
-
net7.0
- LegendaryDependencyInjection (>= 1.0.0.3)
-
net8.0
- LegendaryDependencyInjection (>= 1.0.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.