I have a controller that has the following structure/classes:
// model
public class Result
{
public string Document { get; set; } = "";
public int[,] Segments { get; set; } = new int[,] { };
}
// controller
public class SearchController : ControllerBase {
[HttpGet]
[Route("/api/v1/[controller]")]
[Produces("application/json")]
public IActionResult Search(//metadata list)
{
try {
Result result = <service-call-returning Result object>;
return Ok(result);
} catch (Exception e) {
return BadRequest("bad");
}
}
}
Run Code Online (Sandbox Code Playgroud)
It seems that it's not able to …
我有一个通过 dll 从 F# 导出的可区分联合类型,用于 C#:
type Argument =
| IntValue
| FloatValue
| BoolValue of bool
Run Code Online (Sandbox Code Playgroud)
在C#中我可以初始化类似Argument.NewBoolValue(true),但其他两种类型IntValue并FloatValue没有型式通过F#编译器生成的,因此标记为内部的,是有办法来初始化它们在C#中?