You will learn a lot from the following links:
In conclusion? The metadata is necessary for Entity Framework to create your entity mappings.
Additionally, rather than building it in code, you should think about shifting your connection information out to your configuration file. You may find instructions for doing that on the first link.
Adding to Randolpho's response:
The location of is precisely indicated via the metadata attribute. Storage Model, or SSDL. .MSL (Mapping Model) and.CSDL (Conceptual Model) files. The Entity Data Model is just these three files. The files are included as resources in the built EDM assembly, as indicated by the "res:/" URI-style qualifier.