前两天Insus.NET实现一个功能《


再创建一个Entity:
Clr静态数据Table-Valued函数


打开SqlFunction类,编写table-valued函数:
Clr静态数据Table-Valued函数


可复制代码:

 [SqlFunction(DataAccess = DataAccessKind.None,
                FillRowMethodName = "FillRow_1A",
                TableDefinition = "Id TINYINT,Name NVARCHAR(30), [key] NVARCHAR(30)")
   ]
    public static IEnumerable Tvf_SiteInfor()
    {
        FruitEntity fe = new FruitEntity();
        return fe.GetData();       
    }

    private static void FillRow_1A(object source, out SqlByte id, out SqlChars name, out SqlChars key)
    {
        Si obj = (Si)source;
        id = new SqlByte(obj.Id);
        name = new SqlChars(obj.Name);
        key = new SqlChars(obj.Key);
    }
View Code

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-09-09
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-09
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案