// Import the following namespace
using PowerPortalsPro.Web.Common.Services;
[Inject]
private IViewMetadataCache _viewMetadataCache { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
var allViews = await _viewMetadataCache.GetAllViewsForTableAsync("account");
var viewMetadata = await _viewMetadataCache.GetAsync(new Guid("7A1912D9-2FE4-40B7-8EF3-7806ACAC2EDB"));
// Do stuff with the view metadata.
}
IViewMetadataCache Class
Methods
Name | Parameters | Type | Description |
---|---|---|---|
GetAllViewsForTableAsync | string tableName | Task<IEnumerable<ViewMetadata>> | Returns all the views for the specified table. |