public MenuEntityBase() { this.PermissionValues = new Lazy_ <List <string> >(() => this.PermissionJson?.JsonToEntity <List <string> >(throwIfException: false) ?? new List <string>() { }); }
public IocContext() { this._lazy = new Lazy_ <IContainer>(() => { //创建builder var builder = new ContainerBuilder(); //注册依赖 new BaseDependencyRegistrar().Register(ref builder); //注册额外依赖 if (ValidateHelper.IsPlumpList(this.ExtraRegistrars)) { foreach (var reg in this.ExtraRegistrars) { reg.Register(ref builder); reg.Clean(); } } //额外的切入点 this.OnContainerBuilding?.Invoke(ref builder); //创建容器 var context = builder.Build(); return(context); }).WhenDispose((ref IContainer x) => x.Dispose()); }
public MenuEntity() { string[] ParsePermission() { var res = this.PermissionJson?.JsonToEntity <string[]>(throwIfException: false); return(res ?? new string[] { }); } this.PermissionValues = new Lazy_ <string[]>(ParsePermission); }
public LazyServiceWrapperBase(string name, Func <T> source) { this._name = name; this._lazy = new Lazy_ <T>(source); }
public IocAbpDbContextProvider(IServiceProvider provider) { this._lazy = new Lazy_ <DbContextImpl>(() => provider.Resolve_ <DbContextImpl>()); }