Update Project

This commit is contained in:
2026-03-20 13:04:43 +02:00
parent 9b587e6cba
commit beae2dea89
2295 changed files with 251259 additions and 33 deletions
@@ -0,0 +1,42 @@
using ModestTree;
namespace Zenject
{
[ZenjectAllowDuringValidation]
[NoReflectionBaking]
public class LazyInject<T> : IValidatable
{
readonly DiContainer _container;
readonly InjectContext _context;
bool _hasValue;
T _value;
public LazyInject(DiContainer container, InjectContext context)
{
Assert.DerivesFromOrEqual<T>(context.MemberType);
_container = container;
_context = context;
}
void IValidatable.Validate()
{
_container.Resolve(_context);
}
public T Value
{
get
{
if (!_hasValue)
{
_value = (T)_container.Resolve(_context);
_hasValue = true;
}
return _value;
}
}
}
}