public static ICollection <T> ParseCollection <T>(StringSegment value, Type createType, ParseStringSegmentDelegate parseFn) { if (!value.HasValue) { return(null); } var items = DeserializeArrayWithElements <T, TSerializer> .ParseGenericArray(value, parseFn); return(CollectionExtensions.CreateAndPopulate(createType, items)); }
public static void InitAot <T>() { var hold = DeserializeBuiltin <T> .Parse; hold = DeserializeArray <T[], TSerializer> .Parse; DeserializeType <TSerializer> .ExtractType(null); DeserializeArrayWithElements <T, TSerializer> .ParseGenericArray(null, null); DeserializeCollection <TSerializer> .ParseCollection <T>(null, null, null); DeserializeListWithElements <T, TSerializer> .ParseGenericList(null, null, null); }
public static ICollection <int> ParseIntCollection(StringSegment value, Type createType) { var items = DeserializeArrayWithElements <int, TSerializer> .ParseGenericArray(value, x => int.Parse(x.Value)); return(CollectionExtensions.CreateAndPopulate(createType, items)); }
public static ICollection <string> ParseStringCollection(StringSegment value, Type createType) { var items = DeserializeArrayWithElements <string, TSerializer> .ParseGenericArray(value, Serializer.ParseString); return(CollectionExtensions.CreateAndPopulate(createType, items)); }