Example #1
0
        public async Task <CommandResult <Boolean> > UpdateWebSiteClients([FromBody] IList <WebSiteSectionsViewModel> commands)
        {
            try
            {
                var clients = _mapper.Map <IList <WebSiteSections> >(commands);

                foreach (var item in clients.Where(q => q.Saved == false))
                {
                    if (!string.IsNullOrEmpty(item.ImageFile))
                    {
                        ConfirmFileAdded(item.ImageFile);
                        item.Saved = true;
                    }
                }

                return(await _webSiteManager.UpdateClients(clients));
            }
            catch (Exception ex)
            {
                return(new CommandResult <Boolean>(ex.Message));
            }
        }