The following code:
using FluentResults;
using FluentResults.Extensions.AspNetCore;
using Microsoft.AspNetCore.Mvc;
public class Program
{
public static void Main()
{
var err = Result.Fail(new MyError());
var controller = new MyController();
var result = err.ToActionResult();
Console.WriteLine(result);
}
public class MyController : ControllerBase;
public class MyError() : Error("Error");
}
Gives the error:
System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'System.Collections.Generic.List`1<FluentResults.IError> FluentResults.ResultBase.get_Errors()'.
Source=FluentResults.Extensions.AspNetCore
StackTrace:
at FluentResults.Extensions.AspNetCore.DefaultAspNetCoreResultEndpointProfile.TransformFailedResultToActionResult(FailedResultToActionResultTransformationContext context)
at FluentResults.Extensions.AspNetCore.ResultToActionResultTransformer.Transform(Result result, IAspNetCoreResultEndpointProfile profile)
at FluentResults.Extensions.AspNetCore.ResultExtensions.ToActionResult(Result result, IAspNetCoreResultEndpointProfile profile)
at FluentResults.Extensions.AspNetCore.ResultExtensions.ToActionResult(Result result)
at Program.Main() in C:\Users\chrishunt.QES-OFFICE\source\repos\Countrywide\TestFluentResults\ConsoleApp1\Program.cs:line 11
I believe the problem has been introduced as part of this change: #164
The following code:
Gives the error:
I believe the problem has been introduced as part of this change: #164