예제 #1
0
        /// <summary>
        /// 获取表名
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static string GetTableName(string tableName, Type type)
        {
            var result = string.Empty;

            if (!string.IsNullOrEmpty(tableName))

            {
                result = tableName;
            }
            else
            {
                var tbl = CommonExpand.GetCustomAttribute <TableAttribute>(type, false);

                result = tbl != null?tbl.GetTableName() : type.Name;
            }

            if (result.IndexOf("`") > -1)
            {
                result = result.Replace("`", "");
            }
            if (result.IndexOf("'") > -1)
            {
                result = result.Replace("'", "");
            }
            if (result.IndexOf("[") > -1)
            {
                result = result.Replace("[", "");
            }
            if (result.IndexOf("]") > -1)
            {
                result = result.Replace("]", "");
            }
            return(result);
        }
예제 #2
0
 /// <summary>
 /// 获取IService服务对象
 /// </summary>
 /// <param name="cx"></param>
 /// <returns></returns>
 public static IService GetService(this Window cx)
 {
     return(CommonExpand.GetService());
 }
예제 #3
0
 /// <summary>
 /// 获取IService服务对象
 /// </summary>
 /// <param name="cx"></param>
 /// <returns></returns>
 public static IService GetService(this NotificationObject cx)
 {
     return(CommonExpand.GetService());
 }