private static object CreateInstance(Type type, IReadOnlyDictionary <string, object> row) { var entity = CreateDefault(type); var properties = PortableType.Create(type).Properties; foreach (var i in properties) { i.SetValue(entity, Base(i, row)); } return(entity); }
private static string Properties(PortableType type, string ns, SerializeOption option, Func <PortableProperty, string, SerializeOption, string> serialize) => type.Properties.Select(i => serialize(i, ns, option)).Aggregate(string.Empty, (current, i) => current + i);
public static string LeftJoinsUnion(Type type, string ns) => Properties(PortableType.Create(type), ns, SerializeOption.LeftJoinsUnion, Serializer.Serialize);
public static string ColumnsUnion(Type type, string ns) => Properties(PortableType.Create(type), ns, SerializeOption.ColumnsUnion, Serializer.Serialize)[0..^ 1];