Example #1
0
        private void ProcessParams(DbParameterCollection parameters)
        {
            DbType[] dateTypes = new DbType[] {
                DbType.DateTime,
                DbType.DateTime2,
                DbType.Date
            };

            foreach (DbParameter param in parameters)
            {
                if (param.Value != null && dateTypes.Any(x => x == param.DbType))
                {
                    DateTime date = (DateTime)param.Value;
                    param.Value = date.ToUniversalTime();
                }
            }
        }