Skip to content

Field id assumed to exist #27

@dharmatech

Description

@dharmatech

I ran the following :

dotnet saturn gen Movie Movies Id:int Title:string ReleaseDate:DateTime Genre:string Price:decimal Rating:string

When building, there were many errors like the following:

error FS0039: The type 'Movie' does not define the field, constructor or member 'id'.

The generated code which led to the errors:

image

It looks like Saturn.Cli assumes the existence of a field id. Note that in the above case, the field is Id.

Seems like there are a few ways to resolve this. Saturn.Cli could do one of the following (among other possible suggestions):

  • Refuse to generate code if id is not provided (simplest)
  • Honor a field named Id instead of id
  • Allow the user to specify an id field that is named arbitrarily

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions