skip to Main Content

C# LINQ to select element from string array – Asp.net

I have a string: private const string Codes = "2,10"; public void method() { var displayCodes = Codes.Split(','); DemoResponse response = webService.GetResponse(); //getting response from API if(response.Errors.Any(x => displayCodes.Contains(x.StackTrace)) { int myCode = int.Parse(response.Errors.Select(x => x.StackTrace).FirstOrDefault()); } } This is…

VIEW QUESTION

How to force logout somebody from ASP.NET using Cookies

I would like to know what is the way to force logout somebody when I ban them? I am using this way of login process private async Task SignInWithRoleAsync(string email, string userRoleName) { var identity = new ClaimsIdentity(CookieAuthenticationDefaults.AuthenticationScheme); identity.AddClaim(new Claim(ClaimTypes.Email,…

VIEW QUESTION
Back To Top
Search