AlmarAubel / CSharpFunctionalExtensions.Analyzers

Code analyzers for CSharpFunctionalExtensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pattern matching

AlmarAubel opened this issue · comments

Checks on isSuccess with pattern matching are not recognized as correct check for isSuccess

 return result switch
        {
            { IsSuccess: true } => Ok(result.Value),
            { Error: var err } when err == Foo.Error.NotFound
                => NotFound(),
            _ => InternalServerError(result.Error.UserFriendlyName)
        };