protected virtual ObjectExtensionsDto GenerateCacheValue()
        {
            var objectExtensionsDto = new ObjectExtensionsDto
            {
                Modules = new Dictionary <string, ModuleExtensionDto>()
            };

            foreach (var moduleConfig in ObjectExtensionManager.Instance.Modules())
            {
                objectExtensionsDto.Modules[moduleConfig.Key] = CreateModuleExtensionDto(moduleConfig.Value);
            }

            return(objectExtensionsDto);
        }
        public virtual ObjectExtensionsDto Get()
        {
            if (CachedValue == null)
            {
                lock (SyncLock)
                {
                    if (CachedValue == null)
                    {
                        CachedValue = GenerateCacheValue();
                    }
                }
            }

            return(CachedValue);
        }
        protected virtual void FillEnums(ObjectExtensionsDto objectExtensionsDto)
        {
            var enumProperties = ObjectExtensionManager.Instance.Modules().Values
                                 .SelectMany(
                m => m.Entities.Values.SelectMany(
                    e => e.GetProperties()
                    )
                )
                                 .Where(p => p.Type.IsEnum)
                                 .ToList();

            foreach (var enumProperty in enumProperties)
            {
                // ReSharper disable once AssignNullToNotNullAttribute (enumProperty.Type.FullName can not be null for this case)
                objectExtensionsDto.Enums[enumProperty.Type.FullName] = CreateExtensionEnumDto(enumProperty);
            }
        }