private static IXmlParserResult<int> TryParseInt(IXmlParserResult<string> result, XmlParserState state) { int value; return int.TryParse(result.Value, out value) ? Result.Success(value, state).WithOption(result.IsOption) : Result.Failure<int>(state).WithOption(result.IsOption); }
private static IXmlParserResult<Guid> TryParseGuid(IXmlParserResult<string> result, XmlParserState state) { Guid value; return System.Guid.TryParse(result.Value, out value) ? Result.Success(value, state) : Result.Failure<Guid>(state); }
private static IXmlParserResult<decimal> TryParseDecimal(IXmlParserResult<string> result, XmlParserState state) { decimal value; return decimal.TryParse(result.Value, out value) ? Result.Success(value, state) : Result.Failure<decimal>(state); }