Coder Social home page Coder Social logo

Comments (8)

Dzoukr avatar Dzoukr commented on May 24, 2024 1

Do I really have to downgrade to dotnet core 3.1 to be able to use version > 2.1.0 of this library?

Nope, please use the preview flag in fsproj. We will see where it will go with v3, but my goal is to aim directly for .NET6

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 24, 2024

There are unit tests exercising this, so it should work.
Maybe the problem is because you are not following the query expression with a call to SelectAsync.
For example:

select {
    table "Players"
    innerJoin "Games" "Id" "GameId"
    where (eq "Players.Id" playerId.Value)
}
|> conn.SelectAsync<Player, Game>

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 24, 2024

Also, have you tried using the Linq API?

It would be something like this:

open Dapper.FSharp.LinqBuilders

let playersTable = table'<Player> "Players"
let gamesTable = table'<Game> "Games"
select {
    for p in playersTable do
    join g in gamesTable on (p.GameId = g.Id)
    where (p.Id = playerId.Value)
}
|> conn.SelectAsync<Player, Game>

from dapper.fsharp.

katatunix avatar katatunix commented on May 24, 2024

Maybe the problem is because you are not following the query expression with a call to SelectAsync.

Of course I have the SelectAsync there. The code was totally OK on v2.1.0.

Also, have you tried using the Linq API?

Let me try now, but only for investigation purpose, personally I don't like Linq :D

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 24, 2024

Sure. I only asked in the spirit of troubleshooting. 😉

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 24, 2024

Maybe one guess. Do you use version of F# >= 5 or having preview flag in fsproj?

I recently changed API with using custom operation overloads and marking old methods as Obsolete... So maybe that's the issue.

from dapper.fsharp.

katatunix avatar katatunix commented on May 24, 2024

The Linq API works, except that there is a little warning on join g in gamesTable on (p.GameId = g.Id): The value g is unused. But if I change the first g to _, it becomes an error.

I'm using JetBrains Rider.

By the way, I changed my mind, Linq API is better, since it's more type-safe, especially in where clause.

Any yes, I'm using F# 5, but not having preview flag.

from dapper.fsharp.

tskj avatar tskj commented on May 24, 2024

I have the exact same issue, also on 5. Do I really have to downgrade to dotnet core 3.1 to be able to use version > 2.1.0 of this library?

from dapper.fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.