2
这是一个非常简单的类的静态属性时,每一次变化(fsi.exe)F#静态成员访问
什么是我的目的是存储值静态成员:
type typDimTablesArray() =
static member DimApplication = typDimTables.DimApplication |> Seq.toArray
static member DimApplicationState = typDimTables.DimApplicationState |> Seq.toArray
static member DimDatetime = typDimTables.DimDatetime |> Seq.toArray
static member DimDbQuery = typDimTables.DimDbQuery |> Seq.toArray
static member DimDeveloper = typDimTables.DimDeveloper |> Seq.toArray
static member DimPlatform = typDimTables.DimPlatform |> Seq.toArray
但每次我访问typDimTablesArray.DimDatetime.Length 它只是再次查询数据库,从不将数据存储在静态成员时...
它正在做它应该做的事情。每次你打电话时你都会得到一个随机数字。你能否详细说明你想要做什么以及你的期望是什么。 'Dispose'意味着摆脱实现IDisposable的东西。 – s952163
我知道我可以使用下面的代码,但不知道有什么区别: type test()= static member val ttc =(new Random())。Next()with get,set – ingted
这是一个auto与后台字段属性。如果你需要静态成员,将会做你想做的。 – s952163