1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using Bowin.Common.Utility;
- using Microsoft.Extensions.Configuration;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Threading.Tasks;
- namespace YLShipBuildLandMap.Web
- {
- public class Configuration
- {
- public static Configuration Current
- {
- get
- {
- var configuration = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("appsettings.json")
- .Build();
- Configuration result = new Configuration();
- result.AppSettings = configuration.GetSection("AppSettings").Get<AppSettings>();
- //result.CROSDomainList = configuration.GetSection("Web")
- // .GetSection("Cros")
- // .GetValue<string>("Domain")
- // .Split(",", StringSplitOptions.RemoveEmptyEntries)
- // .Select(x => x.Trim()).ToList();
- return result;
- }
- }
- public AppSettings AppSettings { get; set; }
- public static List<string> Assemblies
- {
- get
- {
- var configuration = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("servicemapping.json")
- .Build();
- return configuration.GetSection("Assemblies").Get<List<string>>() ?? new List<string>();
- }
- }
-
- //public List<string> CROSDomainList { get; set; }
- }
- public class AppSettings
- {
- public string TemplatePath { get; set; }
- public string PicturePath { get; set; }
- public string FilePath { get; set; }
- public string TemplatePhysicalPath
- {
- get
- {
- return HttpHelper.MapPath(TemplatePath);
- }
- }
- }
- }
|