예제 #1
0
        internal EffortDataReader(
            IEnumerable result, 
            int recordsAffected,
            FieldDescription[] fields, 
            DbContainer container)
        {
            this.enumerator = result.GetEnumerator();
            this.recordsAffected = recordsAffected;

            this.fields = fields;
            this.container = container;
        }
예제 #2
0
        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;
        }