C# Class Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Repository.DeviceRegistryRepository

Inheritance: IDeviceRegistryCrudRepository, IDeviceRegistryListRepository
Afficher le fichier Open project: Azure/azure-iot-remote-monitoring Class Usage Examples

Méthodes publiques

Méthode Description
AddDeviceAsync ( DeviceModel device ) : Task

Adds a device to the DocumentDB. Throws a DeviceAlreadyRegisteredException if a device already exists in the database with the provided deviceId

DeviceRegistryRepository ( IDocumentDBClient documentClient ) : System
GetDeviceAsync ( string deviceId ) : Task

Queries the DocumentDB and retrieves the device based on its deviceId

GetDeviceList ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery query ) : Task
RemoveDeviceAsync ( string deviceId ) : System.Threading.Tasks.Task
UpdateDeviceAsync ( DeviceModel device ) : Task

Updates an existing device in the DocumentDB Throws a DeviceNotRegisteredException is the device does not already exist in the DocumentDB

UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task

Private Methods

Méthode Description
GetAllDevicesAsync ( ) : Task>

Queries the DocumentDB and retrieves all documents in the collection

SearchDeviceList ( IQueryable deviceList, string search ) : IQueryable
SearchTypePropertiesForValue ( DeviceModel device, string search ) : bool
SortDeviceList ( IQueryable deviceList, string sortColumn, QuerySortOrder sortOrder ) : IQueryable

Method Details

AddDeviceAsync() public méthode

Adds a device to the DocumentDB. Throws a DeviceAlreadyRegisteredException if a device already exists in the database with the provided deviceId
public AddDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
Résultat Task

DeviceRegistryRepository() public méthode

public DeviceRegistryRepository ( IDocumentDBClient documentClient ) : System
documentClient IDocumentDBClient
Résultat System

GetDeviceAsync() public méthode

Queries the DocumentDB and retrieves the device based on its deviceId
public GetDeviceAsync ( string deviceId ) : Task
deviceId string DeviceID of the device to retrieve
Résultat Task

GetDeviceList() public méthode

public GetDeviceList ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery query ) : Task
query Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery
Résultat Task

RemoveDeviceAsync() public méthode

public RemoveDeviceAsync ( string deviceId ) : System.Threading.Tasks.Task
deviceId string
Résultat System.Threading.Tasks.Task

UpdateDeviceAsync() public méthode

Updates an existing device in the DocumentDB Throws a DeviceNotRegisteredException is the device does not already exist in the DocumentDB
public UpdateDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
Résultat Task

UpdateDeviceEnabledStatusAsync() public méthode

public UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task
deviceId string
isEnabled bool
Résultat Task