I have the following code:
        try
        {
            using (var context = new DataContext())
            {
                if (!context.Database.Exists())
                {
                    // Create the SimpleMembership database without Entity Framework migration schema
                    ((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
                }
            }
            WebSecurity.InitializeDatabaseConnection("xxx", "UserProfile", "UserId", "UserName", autoCreateTables: true);
            var sql = System.IO.File.ReadAllText("SqlScript.sql");
            context.Database.ExecuteSqlCommand(sql);
        }
        catch (Exception ex)
        {
            throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex);
        }
Can someone explain what the purpose of the "using" is ?
 
     
     
     
    