ResultExtensionsErr(String) Method
Creates a result as the Err variant; with the given error information:
errorMessage.
static Res AddUser(User user)
{
if (AlreadyExists(user))
return Err($"user '{user.Id}' already exists.");
if (HasAvailableCapacity(session))
return Err("not enough capacity");
else
{
// add user
return Ok();
}
}
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public static Res Err(
string errorMessage
)
- errorMessage String
- Error message.
Res