在一個(gè)大型系統(tǒng)中,應(yīng)該允許訪問多個(gè)數(shù)據(jù)庫,甚至是多個(gè)異構(gòu)的數(shù)據(jù)庫。例如表單模塊使用mysql,數(shù)據(jù)倉庫模塊使用oracle等等。按照這個(gè)目標(biāo),數(shù)據(jù)的配置信息:
1 "Database": { 2 "ConnectionStrings": [ 3 { 4 "Name": "MicroStrutLibrary", 5 "ConnectionString": "Data Source=XXXX;Initial Catalog=XXXX;User Id=OperUser;Password=OperUser;MultipleActiveResultSets=true;Persist Security Info=true", 6 "ProviderName": "System.Data.SqlClient" 7 }, 8 { 9 "Name": "CMS", 10 "ConnectionString": "Data Source=XXXX;Initial Catalog=XXXX;User Id=OperUser;Password=OperUser;MultipleActiveResultSets=true;Persist Security Info=true", 11 "ProviderName": "System.Data.SqlClient" 12