我的第一個想法是:F# - >通用型 - 多不是struct
type ManyNavigationPropertyInfo<'a,'b>(cfg:ManyNavigationPropertyConfiguration<'a, 'b>) =
但是它解決'a
和'b
爲obj
,但它應該是類 - 所以我所做的:
類型許多導航屬性信息<'a 'a:not struct',b when'b:not struct>(cfg:ManyNavigationPropertyConfiguration <'a, 'b>)=
但只是拋出一個錯誤說在類型名稱
意外的象徵 ''。 預期'>'或其他標記。
聲明這種類型的正確方法是什麼?
UPDATE:
我完整的代碼:
type ManyNavigationPropertyInfo<'a,'b>(cfg:ManyNavigationPropertyConfiguration<'a, 'b>) =
member x.WithMany (expr: Expr<'a -> ICollection<'b>>) =
cfg.WithMany(ToLinq(expr))
,並與2個編譯器錯誤說'a
和'b
應not struct
出現。