温故知新20230317

  1. 接口和抽象类的区别和联系
    https://www.cnblogs.com/binyao/p/4891306.html

抽象基类包含字段、属性 方法的实现;

  1. sqlsugar数据库字段映射实体,底层是如何实现的?

查看缓存,缓存无的情况下;
总结:查询语句 select获取表 架构(DataType,IsNullable,IsIdentity,ColumnDescription,ColumnName,IsPrimarykey,Length,Scale);

public override List<DbColumnInfo> GetColumnInfosByTableName(string tableName, bool isCache = true)
{
  string cacheKey = "DbMaintenanceProvider.GetColumnInfosByTableName." + this.SqlBuilder.GetNoTranslationColumnName(tableName).ToLower();
  cacheKey = GetCacheKey(cacheKey);
  if (!isCache)
      return GetColumnInfosByTableName(tableName);
  else
      return this.Context.Utilities.GetReflectionInoCacheInstance().GetOrCreate(cacheKey,
          () =>
          {
              return GetColumnInfosByTableName(tableName);

          });
}
posted @ 2023-03-17 19:09  弗里德里希恩格hao  阅读(1)  评论(0)    收藏  举报