Saturn.Cli icon indicating copy to clipboard operation
Saturn.Cli copied to clipboard

`int` not supported as type for `id`

Open dharmatech opened this issue 5 years ago • 0 comments

If I follow the steps in the how to start guide, however, use id:int instead of id:string:

dotnet new saturn
dotnet tool restore
dotnet saturn gen Book Books id:int title:string author:string
dotnet saturn migration

Router.fs : browserRouter

  Add the following line

    forward "/books" Books.Controller.resource

dotnet fake build

I get the following error when building:

error FS0001: The type 'int' does not have 'null' as a proper value

This is due to the following line in BooksModel.fs:

fun u -> if isNull u.id then Some ("id", "Id shouldn't be empty") else None

dharmatech avatar Feb 09 '21 22:02 dharmatech