public void FullEntityLoader_Employees() { using (var con = new NameConventionDbConnectionCreator("System.Data.SqlClient").Create()) { con.Open(); var employee = new Employee(); var cmd = con.CreateCommand(); cmd.CommandText = Utils.EmployeeTable.CommandsHolder.Select; var reader = cmd.ExecuteReader(); Assert.IsNotNull(reader); Assert.IsTrue(reader.Read()); new FullEntityLoader(new CachedEntities()).Load(employee, null, reader); reader.Close(); EntitiesAsserts.Assert_Employee_1(employee); } }
public static void ExecuteWith(Action<DbConnection> action) { using (var con = new NameConventionDbConnectionCreator("System.Data.SqlClient").Create()) { con.Open(); try { action(con); } finally { con.Close(); } } }