public CosemObjectController(ICosemObjectRepository r, ICosemLogicalDeviceRepository clr, IDeviceTypeRepository dtr, ICosemClassRepository ccr, ICosemAttributeDataTypeRepository cadtr) { // for tests over real database // does not work... //db = new SGMasterBaseEntities("metadata=res://*/Models.SGMasterBase.csdl|res://*/Models.SGMasterBase.ssdl|res://*/Models.SGMasterBase.msl;provider=System.Data.SqlClient;provider connection string=\"Data Source=.\\SQLEXPRESS;Initial Catalog=SGMasterBase;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework\""); SetRepository(r, clr, dtr, ccr, cadtr, null); }
private void SetRepository(ICosemObjectRepository r, ICosemLogicalDeviceRepository clr, IDeviceTypeRepository dtr, ICosemClassRepository ccr, ICosemAttributeDataTypeRepository cadtr, SGMasterBaseEntities e) { _cosemObjectRepository = r; _cosemObjectRepository.SetEntities(e); _cosemLogicaDeviceRepository = clr; _cosemLogicaDeviceRepository.SetEntities(e); _deviceTypeRepository = dtr; _deviceTypeRepository.SetEntities(e); _cosemClassRepository = ccr; _cosemClassRepository.SetEntities(e); _cosemAttributeDataTypeRepository = cadtr; _cosemAttributeDataTypeRepository.SetEntities(e); }