public async Task OnGetAsync() { var properties = await fpc.GetAllPropertiesAsync(); foreach (var item in properties) { Properties.Add(item); } }
public async Task <IActionResult> OnGetAsync() { var properties = await fpc.GetAllPropertiesAsync(); foreach (var item in properties) { if (!string.IsNullOrEmpty(SearchString) && item.Description.ToLower().Contains(SearchString.ToLower())) { return(RedirectToPage("/File/Index", "PropertyId", new { propertyId = item.Id })); } PropertyDTO pd = new PropertyDTO(); pd.Description = item.Description; pd.Id = item.Id; Properties.Add(pd); } Properties = Properties.OrderBy(x => x.Description).ToList(); return(null); }
public async Task OnGetAsync() { var properties = await fpc.GetAllPropertiesAsync(); foreach (var item in properties) { Properties.Add(item); } if (KeyInput == null) { KeyInput = Properties[0]; } if (!string.IsNullOrEmpty(ValueInput)) { Files = new List <FileDTO>(); var files = await fpc.GetFilesByPropertyAsync(KeyInput, ValueInput); NumberOfFoundItems = files.Count().ToString(); foreach (var item in files) { FileDTO fd = new FileDTO(); fd.Id = item.Id; fd.Path = item.Path; fd.Name = item.Name; fd.Properties = new List <PropertyDTO>(); var fileProperties = await fpc.GetPropertiesByFileIdAsync(item.Id); foreach (var prop in fileProperties) { PropertyDTO propd = new PropertyDTO(); propd.Id = prop.Id; propd.Key = prop.Key; propd.Value = prop.Value; fd.Properties.Add(propd); } Files.Add(fd); } } }