Пример #1
0
        public static void Write(SAEAMvcApplicationConfig config)
        {
            if (config == null)
            {
                config = SAEAMvcApplicationConfig.Default;
            }

            var json = SerializeHelper.Serialize(config);

            FileHelper.WriteString(_FilePath, json);
        }
        /// <summary>
        /// 写入SAEAMvcApplicationConfig.json配置
        /// </summary>
        /// <param name="config"></param>
        public static void Write(SAEAMvcApplicationConfig config)
        {
            if (config == null)
            {
                return;
            }

            string json = string.Empty;

            string filePath = string.Empty;

            try
            {
                filePath = PathHelper.GetFullName("SAEAMvcApplicationConfig.json");

                json = SerializeHelper.Serialize(config);

                FileHelper.WriteString(filePath, json);
            }
            catch (Exception ex)
            {
                LogHelper.Error("SAEAMvcApplicationConfigBuilder.Write ", ex);
            }
        }
Пример #3
0
 /// <summary>
 /// 构建mvc容器
 /// </summary>
 /// <param name="mvcConfig"></param>
 public SAEAMvcApplication(SAEAMvcApplicationConfig mvcConfig) : this(mvcConfig.Root, mvcConfig.Port, mvcConfig.IsStaticsCached, mvcConfig.IsZiped, mvcConfig.BufferSize, mvcConfig.Count, isDebug : mvcConfig.IsDebug)
 {
     _webHost.WebConfig.HomePage = mvcConfig.DefaultPage;
 }
Пример #4
0
 /// <summary>
 /// 构建mvc容器
 /// </summary>
 /// <param name="mvcConfig"></param>
 public SAEAMvcApplication(SAEAMvcApplicationConfig mvcConfig) : this(mvcConfig.Root, mvcConfig.Port, mvcConfig.IsStaticsCached, mvcConfig.IsZiped, mvcConfig.BufferSize, mvcConfig.Count)
 {
     webHost.WebConfig.DefaultPage = "/" + mvcConfig.DefaultPage;
 }