示例#1
0
 public LayoutTypeAdminService(ILogger <LayoutTypeAdminService> logger,
                               ILayoutTypeRepository layoutTypeRepository,
                               IPropertyRepository propertyRepository)
 {
     _logger = logger;
     _layoutTypeRepository = layoutTypeRepository;
     _propertyRepository   = propertyRepository;
 }
示例#2
0
 public LayoutTypeController(ILifetimeScope container)
 {
     _logger = container.Resolve <ILogger <LayoutTypeController> >();
     _layoutTypeRepository = container.Resolve <ILayoutTypeRepository>();
     _hostingEnvironment   = container.Resolve <IHostingEnvironment>();
     try
     {
         var     contentTypesfilePath = Path.Combine(_hostingEnvironment.ContentRootPath, "appcontentcofig.json");
         JObject contentConfig        = JObject.Parse(System.IO.File.ReadAllText(contentTypesfilePath));
         //contentTypes = (JArray)contentConfig.SelectToken("layoutTypes");
         //TODO: Move it to SiteSettings
         _rootAllowedTypes = contentConfig.SelectToken("rootLayoutTypes").ToObject <List <string> >();
     }
     catch (Exception ex)
     {
         _logger.LogError(string.Format("Error occured while initializing LayoutTypeController"), ex);
     }
 }
        public LayoutTypeController(ILogger <LayoutTypeController> logger,
                                    ILayoutTypeRepository layoutTypeRepository,
                                    IWebHostEnvironment hostingEnvironment)
        {
            _logger = logger;
            _layoutTypeRepository = layoutTypeRepository;
            _hostingEnvironment   = hostingEnvironment;
            try
            {
                //var contentTypesfilePath = Path.Combine(_hostingEnvironment.ContentRootPath, "appcontentcofig.json");

                var contentConfig = JObject.Parse(StrContentTypes);
                //contentTypes = (JArray)contentConfig.SelectToken("layoutTypes");
                //TODO: Move it to SiteSettings
                _rootAllowedTypes = contentConfig.SelectToken("rootLayoutTypes").ToObject <List <string> >();
            }
            catch (Exception ex)
            {
                _logger.LogError(string.Format("Error occured while initializing LayoutTypeController"), ex);
            }
        }