public static object As(this object value, Type typeTo) { var nullType = Nullable.GetUnderlyingType(typeTo); if (nullType != null) { return(As(value, nullType)); } var method = Je <MethodInfo> .Key(typeTo, GetConvertMethod); return(method != null?method.Invoke(null, new[] { value }) : null); }
public static FileWay TruFile(this Je.IFssExpander e, string fileName) { return(Je <FileWay> .Key(fileName.ToLower(), x => new FileWay(x))); }