我想使用模型第一種方法來創建實體框架的數據庫。我也想使用多個數據庫模式。有沒有可能創建額外的數據庫模式(稱爲「安全」)以及默認的「dbo」?EF模型中的多個數據庫模式第一個
我還想知道爲什麼執行「從模型生成數據庫」命令後,我的.dmx文件的SSDL部分中的EntitySets模式屬性重置爲「dbo」。
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" mlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="ThewiseModel.Store" Alias="Self" provider="System.Data.SqlClient" ProviderManifestToken="2012" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<EntityContainer Name="ThewiseModelStoreContainer">
<EntitySet Name="PermissionTypes" EntityType="ThewiseModel.Store.PermissionTypes" store:Type="Tables" Schema="Security" />
<EntitySet Name="PermissionValues" EntityType="ThewiseModel.Store.PermissionValues" store:Type="Tables" Schema="Security" />
<EntitySet Name="Roles" EntityType="ThewiseModel.Store.Roles" store:Type="Tables" Schema="Security" />
<EntitySet Name="Users" EntityType="ThewiseModel.Store.Users" store:Type="Tables" Schema="Security" />
<EntitySet Name="Memberships" EntityType="ThewiseModel.Store.Memberships" store:Type="Tables" Schema="Security" />
...
沒有試圖拖釣,但EDMX和EF是一團糟。如果可以,請離開。 – Andomar 2014-08-30 18:30:52