using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GreenTree.Nachtragsmanagement.Core.Data; using GreenTree.Nachtragsmanagement.Core.Domain.Misc; namespace GreenTree.Nachtragsmanagement.Services.Misc { public class MiscService : IMiscService { #region Fields private readonly IRepository _mailNotificationRepository; #endregion #region Ctor /// /// Initializes a new instance of the MiscService class /// public MiscService( IRepository mailNotificationRepository) { _mailNotificationRepository = mailNotificationRepository; } #endregion #region MailNotification /// /// Gets all mailNotifications /// public IList GetAllMailNotifications() { return _mailNotificationRepository.Table.ToList(); } /// /// Gets a mailNotification by specified Id /// /// MailNotification identifier. public MailNotification GetMailNotificationById(int id) { return _mailNotificationRepository.GetById(id); } /// /// Gets all mailNotifications to the specified ids /// public IList GetMailNotificationsByIds(int[] ids) { return _mailNotificationRepository.Table .Where(u => ids.Contains(u.Id)) .ToList(); } /// /// Insert a mailNotification /// /// MailNotification. public void InsertMailNotification(MailNotification mailNotification) { _mailNotificationRepository.Insert(mailNotification); } /// /// Update a mailNotification /// /// MailNotification. public void UpdateMailNotification(MailNotification mailNotification) { _mailNotificationRepository.Update(mailNotification); } /// /// Delete a mailNotification /// /// MailNotification. public void DeleteMailNotification(MailNotification mailNotification) { _mailNotificationRepository.Delete(mailNotification); } #endregion } }