private static void setValuesForProperties(object o) { if (o is null) { return; } foreach (var p in GetClass.Properties(o.GetType())) { if (!p.CanWrite) { return; } var v = GetRandom.Value(p.PropertyType); p.SetValue(o, v); } }
private static void setValuesForProperties(object o) { if (o is null) { return; } var t = o.GetType(); var properties = GetClass.Properties(t); foreach (var p in properties) { if (!p.CanWrite) { continue; } var v = GetRandom.Value(p.PropertyType); p.SetValue(o, v); } }