Skip to content

Just wonder reason of the casting? #1573

@akrsnr

Description

@akrsnr

var dog = connection.Query<Dog>("select Age = @Age, Id = @Id", new { Age = (int?)null, Id = guid });

Why do you need to cast null to (int?) here?

I can understand the reason for the casting for the below one, but yours.

Main()
{
	T.A(null);
}

public class T {
	public static void A(string x) => Console.WriteLine("str");
	public static void A(List<int> x) => Console.WriteLine("list");
}

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