コード例 #1
0
        public static string GetResource(string key)
        {
            if (key != String.Empty)
            {
                var instance = ResourceContext.GetInstance();

                string value = String.Empty;
                instance.Resources.TryGetValue(key, out value);
                if (value == null || value == String.Empty)
                {
                    return($"[{key}]");
                }
                return(value);
            }
            return("Key is empty");
        }
コード例 #2
0
 public ResourcesService(IServiceProvider serviceProvider, IConfiguration configuration)
 {
     _provider      = serviceProvider;
     _instance      = ResourceContext.GetInstance();
     _configuration = configuration;
 }
コード例 #3
0
 public ResourcesController(WebAppContext context)
 {
     _context  = context;
     _instance = ResourceContext.GetInstance();
 }