private void SetPropertyOnObject <T>(PropertyInfo typeProperty, T newItem) where T : new() { if (TableConstants.ReservedPropertyNames.Contains(typeProperty.Name)) { return; } IObjectToTypeConverter objectConverter = ObjectConverterFactory.GetConverterFor(typeProperty.PropertyType); typeProperty.SetValue(newItem, objectConverter.ConvertToValue(_properties[typeProperty.Name], typeProperty), null); }
private static Dictionary <string, EntityProperty> GetProperties(Dictionary <string, Tuple <object, Type> > properties) { var entityProperties = new Dictionary <string, EntityProperty>(); foreach (KeyValuePair <string, Tuple <object, Type> > property in properties) { Type propertyType = property.Value.Item2; IObjectToTypeConverter converter = ObjectConverterFactory.GetConverterFor(propertyType); entityProperties[property.Key] = converter.ConvertToEntityProperty(property.Value.Item1, propertyType); } return(entityProperties); }