public Models.PageSubscriberDashboard Post([FromBody] Models.PageSubscriberDashboard PageSubscriberDashboard)
 {
     if (ModelState.IsValid && PageSubscriberDashboard.ModuleId == _entityId)
     {
         PageSubscriberDashboard = _PageSubscriberDashboardRepository.AddPageSubscriberDashboard(PageSubscriberDashboard);
         _logger.Log(LogLevel.Information, this, LogFunction.Create, "PageSubscriberDashboard Added {PageSubscriberDashboard}", PageSubscriberDashboard);
     }
     return(PageSubscriberDashboard);
 }
예제 #2
0
        public void ImportModule(Module module, string content, string version)
        {
            List <Models.PageSubscriberDashboard> PageSubscriberDashboards = null;

            if (!string.IsNullOrEmpty(content))
            {
                PageSubscriberDashboards = JsonSerializer.Deserialize <List <Models.PageSubscriberDashboard> >(content);
            }
            if (PageSubscriberDashboards != null)
            {
                foreach (var PageSubscriberDashboard in PageSubscriberDashboards)
                {
                    _PageSubscriberDashboardRepository.AddPageSubscriberDashboard(new Models.PageSubscriberDashboard {
                        ModuleId = module.ModuleId, Name = PageSubscriberDashboard.Name
                    });
                }
            }
        }