Esempio n. 1
0
        public IEnumerable <NotificationsDTO> GetNotifications([FromBody] NameDTO id)//Wade Please Review this Code, Will this work?
        {
            DesktopNotification t = new DesktopNotification()
            {
                Company = new Company(), LoginDetails = new LoginDetails()
                {
                    Company = new Company(), Role = new Role()
                }
            };

            t.InsertDocument();
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("Company.Name", id.Name);
            List <CRUDAble> notes = t.SearchDocument(parameters);

            notes.Remove(t);
            t.Delete();
            List <NotificationsDTO> notifications = new List <NotificationsDTO> ();


            foreach (DesktopNotification item in notes)
            {
                notifications.Add(new NotificationsDTO(item));
            }

            return(notifications);
        }