예제 #1
0
 public IEnumerable <TicketDatabase> GetAllTicket()
 {
     lock (_locker)
     {
         TableQuery <TicketDatabase> ticketsDatabase = DatabaseManager.Instance.GetTable <TicketDatabase>();
         return(ticketsDatabase.AsEnumerable());
     }
 }
예제 #2
0
        public void DeleteTicket(int ticketId)
        {
            lock (_locker)
            {
                TableQuery <TicketDatabase> ticketsDatabase = DatabaseManager.Instance.GetTable <TicketDatabase>();
                var ticketDatabase = ticketsDatabase
                                     .AsEnumerable()
                                     .FirstOrDefault(x => x.DatabaseID == ticketId);

                DatabaseManager.Instance.Delete(ticketDatabase);
            }
        }
예제 #3
0
        public T GetElement <T>(string databaseId) where T : IStringIdEntity, new()
        {
            TableQuery <T> tableElementsDatabase = GetTable <T>();

            return(tableElementsDatabase.AsEnumerable().SingleOrDefault(x => x.DatabaseID.Equals(databaseId)));
        }
예제 #4
0
        // Read
        public T GetElement <T>(int databaseId) where T : IIntIdEntity, new()
        {
            TableQuery <T> tableElementsDatabase = GetTable <T>();

            return(tableElementsDatabase.AsEnumerable().SingleOrDefault(x => x.DatabaseID == databaseId));
        }
예제 #5
0
 public IEnumerable <T> GetAll()
 {
     return(_query.AsEnumerable());
 }