public IEnumerable<TrusteeEntity> GetTrustees(string urn)
{
IList<TrusteeEntity> trustees = new List<TrusteeEntity>();
using (SqlConnection con = new SqlConnection(DatabaseHelper.MainConnectionString))
{
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "select tr.Id, tr.FirstName, tr.LastName, tr.Title, tr.Addr1, tr.Addr2, tr.Town, tr.County, tr.Postcode from Trt "+
"inner join Trstees tr on t.Id;
con.Open();
var reader = cmd.ExecuteReader();
ReadT(reader, trustees);
}
}
return trustees;
}
You can you ADO.NET approach like my example. Or you can use different ORM than Entity framework. Or you can all sql procedure instead... There is a lot of options ;).