現在需要說說,需要注意的問題:在使用這個架子的時候一定需要注意的是:連接串一定要在配置文件裏面定義好:庫1 庫2的連接串需要預先定義的。
<connectionStrings>
<add name="EntitiesContainer" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=JFrameDB;User ID=sa;Password=123456;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="EntitiesContainerTest" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=JFrameDBTest;User ID=sa;Password=123456;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
第二個地方時,如果使用緩存類的時候,需要注意的在 Global
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
new JFrame.Business.CommonCacheDataInit();
}
中,預先要把數據實例化一次,不然第一次數據是空的。
調用這樣的方法去預先實例化:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JFrame.Dal
{
public class CommonCacheDataInit
{
public CommonCacheDataInit()
{
new SysControlAndRolesDal();
new SysControlAndUserDal();
new SysControlDal();
new SysFunctionandRolesDal();
new SysFunctionDal();
new SysMenuDal();
new SysOrgStructureDal();
new SysRoleMenuDal();
new SysRolesDal();
new SysUserBaseDal();
new SysUserMenuDal();
new SysUserRoleDal();
new SysOrgDepartmentDal();
new SysOrgPositionDal();
new SysPositionAndUserDal();
new SysKnowLedgeDal();
new SysAreaDal();
new SysDataModelViewInfoDal();
new SysDataBaseInfoDal();
new SysDataColumsDal();
}
}
}
還有就是,因爲的架構思想很簡單,就是業務層每個邏輯我一定是分開的,所以和部分人的想法不太一樣,也請大家見諒了。
很多人喜歡把MVC和架構混爲一談,我也不是很展成,所以可能會有些出入在裏面。
到現在 這套架子就算完成了。請大家多多支持。