Entity Framework Connection String Definition

佐手、 提交于 2019-12-10 14:07:57

问题


I was just wondering that, what is Entity Framework Connection String really mean? Like:

metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=testSource;initial catalog=CatalogName;user id=sa;password=***********;multipleactiveresultsets=True;application name=EntityFramework"

I am aware of provider=System.Data.SqlClient; provider connection string="data source=testSource; initial catalog=CatalogName; user id=sa; password=**

Can anyone tell me what does string metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl; mean?

And, one more thing i need to confirm, if i want to edit in the Entity Connection String, can i do it?


回答1:


The metadata field is required in an EF connection string and specifies:

A pipe-delimited list of directories, files, and resource locations in which to look for model and mapping information.

(source: http://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnection.connectionstring.aspx)

Or put in other words:

The pointer to the metadata files (Conceptual Schema Definition Layer [CSDL], Mapping Schema Layer [MSL], and Store Schema Definition Layer [SSDL])

(source: http://msdn.microsoft.com/en-us/library/orm-9780596520281-01-16.aspx)




回答2:


Everything what you need, you have in manual:

http://msdn.microsoft.com/en-us/library/cc716756%28v=vs.110%29.aspx#fbid=FpiOK3ZYdUD



来源:https://stackoverflow.com/questions/21134573/entity-framework-connection-string-definition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!