I have a function defined in a DataAccess module like this
module DataAccess let getData() = ["abc";"def"]
Then I use the F # MVC controller to pull the data like this:
[<HandleError>] type FitnessController() = inherit Controller() member x.Index() = let data = DataAccess.getData() |> List.map(fun p -> p) |> List.toArray x.View(data) :> ActionResult
I get intellisense and everything builds well, but when the webpage pops up, it says the method does not exist
Method not found: 'Microsoft.FSharp.Collections.FSharpList`1<Models.Entity> DataAccess.getData()'.
When I look at the assembly in dotPeek, it appears as a static method that returns an FSharp list. Did I miss something obvious here?
(Ignore the fact that getData and the map function do nothing, I omitted the code for short, getData just contains record types that are marked as serializable, but I still get the error even when using strings, as in the code example here) I also I have to say that this is MVC 3 with Razor C # pages.
Dylan source share