When i declare the var as LookupItem, the insert is correct, but when i declare the var as an interface, the ‘wrong’ object is inserted. How can i force the insert command to insert the implementation instead of the interface?
System.Data.SqlClient.SqlException : Invalid object name ‘IEntity’.
using (IDbConnection connection = factory.OpenDbConnection())
{
using (IDbTransaction transaction = connection.OpenTransaction())
{
IEntity item = new LookupItem { Code = "Code" };
item.Id = connection.Insert(item, true);
transaction.Commit();
}
}