resultDict = primaryDict.Keys.Intersect(secondaryDict.Keys).ToDictionary(t => t, t => primaryDict[t]); or, alternatively: resultDict = primaryDict.Where(x => secondaryDict.ContainsKey(x.Key)).ToDictionary(x => x.Key, x => x.Value); [GeneratedRegex("^([a-zA-Z_][0-9a-zA-Z_-]+)$")] public static partial Regex G_REGEX_NAME(); G_REGEX_NAME().IsMatch(text) s1[1..^1] public bool HasMasters => Masters?.Any() ?? false; public HtmlString AppNameHtml => _appNameHtml ??= AppName.ToHtml(); private HtmlString _appNameHtml; var useSSO = (bool)(ViewData.Eval("useSSO") ?? false); @model dynamic @{ var key1 = (string)(ViewData.Eval("key1") ?? ""); var key2 = (int)(ViewData.Eval("key2") ?? 0); }

Test: "@key1", @key2

@Current.QueryString.Helper.GetQueryString(Current.HostApplicationUrl)

TempData["ListRouteValues"] is RouteValueDictionary r1 // Encoding ENCODING_WINDOWS1251(1251), ENCODING_KOI8R(20866), ENCODING_CP866(866), ENCODING_ISO88591("iso-8859-1") Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); string style1 = "test" switch { "test" => "background-image: url('https://priem.guap.ru/images/sky-mag.png');", _ => "background-image: url('https://priem.guap.ru/images/sky-mag.png');" }; Func createString = (a, b) => $"{a}{b}";