internal EffortDataReader( IEnumerable result, int recordsAffected, FieldDescription[] fields, DbContainer container) { this.enumerator = result.GetEnumerator(); this.recordsAffected = recordsAffected; this.fields = fields; this.container = container; }
public static Dictionary<string, object> CreateReturningEntity( ActionContext context, FieldDescription[] returningFields, object entity) { Dictionary<string, object> entityReturningValues = new Dictionary<string, object>(); for (int i = 0; i < returningFields.Length; i++) { string property = returningFields[i].Name; object value = entity.GetType().GetProperty(property).GetValue(entity, null); entityReturningValues[property] = context .DbContainer .TypeConverter .ConvertClrObject(value, returningFields[i].Type); } return entityReturningValues; }