小编eri*_*ric的帖子

使用F#SqlDataConnection,Linq to Sql时出错,'不支持返回自引用常量表达式的IQueryable'

我正在撰写一份注定要成为Azure功能的销售报告.使用FSharp.Data.TypeProviders.SqlDataConnection进行数据访问我System.NotSupportedException: An IQueryable that returns a self-referencing Constant expression is not supported.在尝试解析产品的父部门时遇到了问题.

脚本看起来像这样:

#r "System.Data.dll"
#r "FSharp.Data.TypeProviders.dll"
#r "System.Data.Entity.dll"
#r "System.Data.Linq.dll"

open System
open Microsoft.FSharp.Data
open Microsoft.FSharp.Data.TypeProviders
open System.Linq
open System.Data.Linq
open System.Data.Entity

type DbConn = SqlDataConnection< @"super secrete connection string here">

type SubSelOut = { ``Department Name``: String;
                   ``Parent Id``: Nullable<int>;
                   ``Product Id``: int }

[< CLIMutable >]
type QueryGrouping = {``Product Id``: Nullable<int>;
                       ``Product SKU``: string;
                       Price: Decimal;
                       ``Department Name``: string;
                       ``Parent Department Name``: string; } …
Run Code Online (Sandbox Code Playgroud)

f# type-providers f#-data

5
推荐指数
0
解决办法
213
查看次数

标签 统计

f# ×1

f#-data ×1

type-providers ×1