public DType Accept(TLong type, string x) { if (long.TryParse(x, out var b)) { return(DLong.ValueOf(b)); } else { throw new Exception($"{x} 不是long类型"); } }
public DType Accept(TLong type, ExcelStream x) { var d = x.Read(); if (CheckNull(type.IsNullable, d)) { return(null); } var ds = d.ToString(); //if (field?.Remapper is TEnum te) //{ // if (te.DefineEnum.TryValueByNameOrAlias(ds, out var c)) // { // return DLong.ValueOf(c); // } //} if (!long.TryParse(ds, out var v)) { throw new InvalidExcelDataException($"{d} 不是 long 类型值"); } return(DLong.ValueOf(v)); }
public DType Accept(TLong type, XElement x, DefAssembly ass) { return(DLong.ValueOf(long.Parse(x.Value.Trim()))); }
public DType Accept(TLong type, JsonElement x, DefAssembly ass) { return(DLong.ValueOf(x.GetInt64())); }