public DeviceAttributeController(IDeviceAttributeRepository r, IDeviceRepository dr, IDeviceTypeRepository dtr, ICosemObjectRepository cor, ICosemAttributeValueRepository car) { // 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, car, null); }
private void SetRepository(IDeviceAttributeRepository r, IDeviceRepository dr, IDeviceTypeRepository dtr, ICosemObjectRepository cor, ICosemAttributeValueRepository car, SGMasterBaseEntities e) { _deviceAttributeRepository = r; _deviceAttributeRepository.SetEntities(e); _deviceRepository = dr; _deviceRepository.SetEntities(e); _deviceTypeRepository = dtr; _deviceTypeRepository.SetEntities(e); _cosemObjectRepository = cor; _cosemObjectRepository.SetEntities(e); _cosemAttributeRepository = car; _cosemAttributeRepository.SetEntities(e); }
public DeviceAttributeController(IMapper mapper, IDeviceAttributeRepository repo, IAuthority auth) { _mapper = mapper; _repo = repo; _auth = auth; }