public DeviceObjectController(IDeviceObjectRepository r, IDeviceRepository dr, IDeviceTypeRepository dtr, ICosemObjectRepository cor) { // 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, dr, dtr, cor, null); }
private void SetRepository(IDeviceObjectRepository r, IDeviceRepository dr, IDeviceTypeRepository dtr, ICosemObjectRepository cor, SGMasterBaseEntities e) { _deviceObjectRepository = r; _deviceObjectRepository.SetEntities(e); _deviceRepository = dr; _deviceRepository.SetEntities(e); _deviceTypeRepository = dtr; _deviceTypeRepository.SetEntities(e); _cosemObjectRepository = cor; _cosemObjectRepository.SetEntities(e); }
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); }