Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public async Task <IActionResult> GetAllBlocks([FromQuery] string siteId)
 => OkOrBadRequest(await blockService.GetAll(siteId));