FileSystemItem.Key Property
In This Article
Specifies a file system item’s key.
Namespace: DevExtreme.AspNet.Mvc.FileManagement
Assembly: DevExtreme.AspNet.Core.dll
#Declaration
C#
public string Key { get; set; }
#Property Value
Type | Description |
---|---|
String | The key. |
#Remarks
The following example illustrates how to use the Key property to set a unique key for each file system item inside the GetItems(FileSystemLoadItemOptions) method. Refer to the FileManager - Binding to Entity Framework ORM online demo to see the whole code.
File system provider:
public IEnumerable<FileSystemItem> GetItems(FileSystemLoadItemOptions options) {
int parentId = ParseKey(options.Directory.Key);
var fileItems = GetDirectoryContents(parentId);
var clientItemList = new List<FileSystemItem>();
foreach(var item in fileItems) {
var clientItem = new FileSystemItem {
Key = item.Id.ToString(),
Name = item.Name,
//...
};
clientItemList.Add(clientItem);
}
return clientItemList;
}
#Concepts
#Online Demos
See Also