/// <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); }
/// <summary> /// 获取IService服务对象 /// </summary> /// <param name="cx"></param> /// <returns></returns> public static IService GetService(this Window cx) { return(CommonExpand.GetService()); }
/// <summary> /// 获取IService服务对象 /// </summary> /// <param name="cx"></param> /// <returns></returns> public static IService GetService(this NotificationObject cx) { return(CommonExpand.GetService()); }