コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iclist"></param>
        /// <param name="ctype">Clear type: 3 - all, 2 - ASC, 1 - DESC</param>
        /// <returns></returns>
        private static IEnumerable <string> ParseColumnListIndexClear(string iclist, IndexClearType ctype)
        {
            foreach (var column in iclist.Split(','))
            {
                var name = column.Trim();
                if (string.IsNullOrEmpty(name))
                {
                    continue;
                }

                if (name.EndsWith(@" ASC") && (ctype & IndexClearType.Asc) == IndexClearType.Asc)
                {
                    yield return(name.Replace(@" ASC", string.Empty).Trim());
                }
                else if (name.EndsWith(@" DESC") && (ctype & IndexClearType.Desc) == IndexClearType.Desc)
                {
                    yield return(name.Replace(@" DESC", string.Empty).Trim());
                }
                else
                {
                    yield return(name);
                }
            }
        }
コード例 #2
0
ファイル: DBSchemaDriverBase.cs プロジェクト: rsdn/janus
		/// <summary>
		/// 
		/// </summary>
		/// <param name="iclist"></param>
		/// <param name="ctype">Clear type: 3 - all, 2 - ASC, 1 - DESC</param>
		/// <returns></returns>
		private static IEnumerable<string> ParseColumnListIndexClear(string iclist, IndexClearType ctype)
		{
			foreach (var column in iclist.Split(','))
			{
				var name = column.Trim();
				if (string.IsNullOrEmpty(name))
					continue;

				if (name.EndsWith(@" ASC") && (ctype & IndexClearType.Asc) == IndexClearType.Asc)
					yield return name.Replace(@" ASC", string.Empty).Trim();
				else if (name.EndsWith(@" DESC") && (ctype & IndexClearType.Desc) == IndexClearType.Desc)
					yield return name.Replace(@" DESC", string.Empty).Trim();
				else
					yield return name;
			}
		}