为什么找不到ICustomTypeDescriptor

时间:2017-04-15 05:19:46

标签: sqlite f# portable-class-library

我使用FSharp中的库为Windows,Android和iOS制作了PCL。我终于让SqlDataProvider工作,但每当我编写代码以尝试访问查询中的实体的属性时,模块声明会显示一条错误,指出在System.ComponentModel上找不到ICustomTypeDescriptor。此外,我没有得到任何关于交易实体的属性的智能感知。

module CashFlowData

open FSharp.Data.Sql
open System.IO
open System
open CashFlow

let [<Literal>] resolutionPath = __SOURCE_DIRECTORY__ + "\packages\System.Data.SQLite.dll";
let [<Literal>] connectionString = "DataSource=" + __SOURCE_DIRECTORY__ + @"\CashFlowDb.sqlite3;Version=3"

type private sql = SqlDataProvider<
                    ConnectionString = connectionString,
                    DatabaseVendor = Common.DatabaseProviderTypes.SQLITE,
                    SQLiteLibrary = Common.SQLiteLibrary.SystemDataSQLite,
                    ResolutionPath = resolutionPath,
                    UseOptionTypes = true>

let ctx = sql.GetDataContext()

let transactions (period : Period) (budget : Budget) =
query { 
    for transaction in ctx.Main.Transaction do
    where (transaction.Date <= period.End && transaction.Date >= period.End
            && transaction.Fk_BudgetId = budget.Id)
    select transaction
}

0 个答案:

没有答案