DapperExtensions produces "Invalid object name" on insert operation

I am following a simple insert example at https://github.com/tmsmith/Dapper-Extensions#simple-insert-operation

public class Org
{
    public int Id { get; set; }
    public string Name { get; set; }
}

SqlConnection conn = new SqlConnection("...");
conn.Open();
Org org = new Org() { Name = "Just Testing" };
int id = conn.Insert(org);
conn.Close();

      

It gives me System.Data.SqlClient.SqlException: Invalid object name 'Org'.

What am I doing wrong here? The table exists and was generated by EF Code First with a standard subclass DbContext

containingpublic DbSet<Org> Orgs { get; set; }

+3


source to share





All Articles