Closing connections explicitly in Entity Framework

Reading the microsoft documentation http://msdn.microsoft.com/en-us/library/bb738684.aspx I see they explicitly open and close the connection

using (EntityConnection conn = new EntityConnection("name=AdventureWorksEntities"))
{ 
    conn.Open();
    ...
    conn.Close();
}

why is this necessary?

14
задан Carlo V. Dango 12 March 2011 в 22:20
поделиться