public Models.PageSubscriber Post([FromBody] Models.PageSubscriber PageSubscriber) { if (ModelState.IsValid && PageSubscriber.ModuleId == _entityId) { PageSubscriber = _PageSubscriberRepository.AddPageSubscriber(PageSubscriber); _logger.Log(LogLevel.Information, this, LogFunction.Create, "PageSubscriber Added {PageSubscriber}", PageSubscriber); } return(PageSubscriber); }
public void ImportModule(Module module, string content, string version) { List <Models.PageSubscriber> PageSubscribers = null; if (!string.IsNullOrEmpty(content)) { PageSubscribers = JsonSerializer.Deserialize <List <Models.PageSubscriber> >(content); } if (PageSubscribers != null) { foreach (var PageSubscriber in PageSubscribers) { _PageSubscriberRepository.AddPageSubscriber(new Models.PageSubscriber { ModuleId = module.ModuleId, FirstName = PageSubscriber.FirstName }); } } }