bool INewsletterHelper.TrySave(Models.Home.NewsletterModel model) { string mail = model.Email; int selectedId = model.selectedTypeOfNews; var currentTime = DateTime.Now; var modelToSave = new Newsletter() { email = mail, TypeOfNewsId = selectedId, InsertTime = currentTime }; _newsletterRepository.Add(modelToSave); return true; }
void INewsletterRepository.Add(Newsletter news) { context.Newsletter.Add(news); context.SaveChanges(); }