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"); }
public ResourcesService(IServiceProvider serviceProvider, IConfiguration configuration) { _provider = serviceProvider; _instance = ResourceContext.GetInstance(); _configuration = configuration; }
public ResourcesController(WebAppContext context) { _context = context; _instance = ResourceContext.GetInstance(); }