using System.Collections.Generic; using System.Linq; using Neo.Afx.ComponentModel; namespace Neo.Afx.Admin.Svc { /// /// Afx admin database /// public class AfxAdminSvcDatabase : Database { /// /// Constructor /// public AfxAdminSvcDatabase() : base(new AfxAdminSvcContext()) { } #region PollFrequencies /// /// Get all data from table. /// /// List of objects public IEnumerable GetPollFrequencys() { return (from item in Context.PollFrequencies orderby item.Title ascending select item).ToList(); } /// /// Get data from table based on count. /// /// Restricts amount returned items in the collection. /// List of objects. public IEnumerable GetPollFrequencys(int count) { return (from item in Context.PollFrequencies orderby item.Title ascending select item).Take(count).ToList(); } #endregion #region GetServices /// /// Get all data from table. /// /// List of objects public IEnumerable GetServices() { return (from item in Context.Services orderby item.ServiceName ascending select item).ToList(); } /// /// Get data from table based on count. /// /// Restricts amount returned items in the collection. /// List of objects. public IEnumerable GetServices(int count) { return (from item in Context.Services orderby item.ServiceName ascending select item).Take(count).ToList(); } #endregion } }