Example #1
0
        public static void SetValue(this DbParameterCollection collection, object entity)
        {
            var pList = entity.GetType().GetPropertyExecutorList();

            foreach (var propertyExecutorse in pList)
            {
                var tempParam = string.Format("@{0}", propertyExecutorse.Key);

                if (collection.Contains(tempParam))
                {
                    collection.SetValue(tempParam, propertyExecutorse.Value.GetValue(entity));
                }
            }
        }