internal List <TDto> RetrieveAllBlock <TDto>(IDataConverter <BlockData, TDto> converter) where TDto : class { ArgumentValidator.IsNotNull("converter", converter); IBlockService service = UnitOfWork.GetService <IBlockService>(); var query = service.GetAll(); if (query.HasResult) { return(query.DataToDtoList(converter).ToList()); } return(null); }
internal IList <BindingListItem> GetBindingList() { List <BindingListItem> dataSource = new List <BindingListItem>(); IBlockService service = UnitOfWork.GetService <IBlockService>(); var query = service.GetAll(); if (query.HasResult) { foreach (BlockData data in query.DataList) { dataSource.Add(new BindingListItem(data.Id, data.Name)); } } return(dataSource); }
public async Task <IActionResult> GetAllBlocks([FromQuery] string siteId) => OkOrBadRequest(await blockService.GetAll(siteId));