Skip to content

Create longer version does not contains the primary key #378

Closed
@diegobfernandez

Description

@diegobfernandez

Description

The Create() method does not contains the table primary key.

Repro steps

  1. Create table
CREATE TABLE unidadeDeMedida (
  codigo INT PRIMARY KEY,
  descricao NVARCHAR(250) NOT NULL
)
  1. Define type
type Db =
    SqlDataProvider<Common.DatabaseProviderTypes.MYSQL,
                    DesignConnectionString,
                    ResolutionPath = ResolutionPath,
                    UseOptionTypes = true,
                    CaseSensitivityChange = CaseSensitivityChange.ORIGINAL>
  1. Try to access Create(codigo, descricao)
let InserirUnidadesDeMedida connectionString unidadesDeMedida =
  let ctx = Db.GetDataContext connectionString
  unidadesDeMedida
  |> Seq.map (fun x ->
    ctx.Mdic.UnidadeDeMedida.``Create(codigo, descricao)``(x.Codigo, x.Descricao))
  |> ignore

  ctx.SubmitUpdates ()

Expected behavior

The Create(codigo, descricao) should exist.

Actual behavior

Compile error

FS0039: The field, constructor or member 'Create(codigo, descricao)' is not defined

Known workarounds

Do not use Create(...) method

Related information

  • Used database: MariaDB 10.1.21
  • Operating system: Fedora 25
  • Branch: The one from Nuget (1.0.42)
  • .NET Runtime, CoreCLR or Mono Version: Mono 4.6.2.16

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions