public DeviceOwnerController(IDeviceOwnerRepository r) { // 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, null); }
private void SetRepository(IGroupRepository r, IDeviceRepository dr, IDeviceTypeAndOwnerRepository dt, IDeviceTypeRepository dtr, IDeviceOwnerRepository dor, IDeviceLogicalDeviceRepository or, SGMasterBaseEntities e) { DeviceTypeAndOwnerRepository = dt; DeviceTypeAndOwnerRepository.SetEntities(e); DeviceTypeRepository = dtr; DeviceTypeRepository.SetEntities(e); GroupRepository = r; GroupRepository.SetEntities(e); DeviceRepository = dr; DeviceRepository.SetEntities(e); DeviceOwnerRepository = dor; DeviceOwnerRepository.SetEntities(e); DeviceLogicalDeviceRepository = or; DeviceLogicalDeviceRepository.SetEntities(e); }
private void SetRepository(IDeviceOwnerRepository r, SGMasterBaseEntities e) { _deviceOwnerRepository = r; _deviceOwnerRepository.SetEntities(e); }