skip to Main Content

After migrating to .NET 5 shows an error "Use of unassigned local variable" for out parameter – Asp.net

public bool TryGetCustomerId(out Guid customerId) { customerId = Guid.Empty; if (_contextAccessor.HttpContext?.Request.Headers.TryGetValue(CustomKnownHeaders.CustomerId, out var values) ?? false) { return Guid.TryParse(values.FirstOrDefault(), out customerId); } return false; } After migrating from .NET Core 3.1 to .NET 5 shows an error "Use of unassigned…

VIEW QUESTION
Back To Top
Search