✨ Add SPA to the Drive project for further usage
This commit is contained in:
		
							
								
								
									
										24
									
								
								DysonNetwork.Drive/Pages/Data/VersionPageData.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								DysonNetwork.Drive/Pages/Data/VersionPageData.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| using DysonNetwork.Shared.Data; | ||||
| using DysonNetwork.Shared.PageData; | ||||
|  | ||||
| namespace DysonNetwork.Drive.Pages.Data; | ||||
|  | ||||
| public class VersionPageData : IPageDataProvider | ||||
| { | ||||
|     public bool CanHandlePath(PathString path) => true; | ||||
|  | ||||
|     public Task<IDictionary<string, object?>> GetAppDataAsync(HttpContext context) | ||||
|     { | ||||
|         var versionData = new AppVersion | ||||
|         { | ||||
|             Version = ThisAssembly.AssemblyVersion, | ||||
|             Commit = ThisAssembly.GitCommitId, | ||||
|             UpdateDate = ThisAssembly.GitCommitDate | ||||
|         }; | ||||
|  | ||||
|         var result = typeof(AppVersion).GetProperties() | ||||
|             .ToDictionary(property => property.Name, property => property.GetValue(versionData)); | ||||
|  | ||||
|         return Task.FromResult<IDictionary<string, object?>>(result); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user