#11: start implementing handling of enumerables for Read method

pull/26/head
Simon Gockner 6 years ago
parent ddee6106d9
commit f705e6790e
  1. 7
      GBase/DataHandling/XmlDataReader.cs

@ -3,6 +3,7 @@
// Copyright(c) 2020 SimonG. All Rights Reserved.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -88,6 +89,12 @@ namespace GBase.DataHandling
return null;
IEnumerable<string> values = valueElements.Select(v => v.Value);
if (typeof(TProperty) != typeof(string) && typeof(TProperty).GetInterfaces().Contains(typeof(IEnumerable)))
{
return null; //FixMe: Implement handling for IEnumerables
}
return values.Select(value => (TProperty)Convert.ChangeType(value, typeof(TProperty))).ToList();
}, _cancellationToken);
}

Loading…
Cancel
Save