public IEnumerable <TicketDatabase> GetAllTicket() { lock (_locker) { TableQuery <TicketDatabase> ticketsDatabase = DatabaseManager.Instance.GetTable <TicketDatabase>(); return(ticketsDatabase.AsEnumerable()); } }
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); } }
public T GetElement <T>(string databaseId) where T : IStringIdEntity, new() { TableQuery <T> tableElementsDatabase = GetTable <T>(); return(tableElementsDatabase.AsEnumerable().SingleOrDefault(x => x.DatabaseID.Equals(databaseId))); }
// Read public T GetElement <T>(int databaseId) where T : IIntIdEntity, new() { TableQuery <T> tableElementsDatabase = GetTable <T>(); return(tableElementsDatabase.AsEnumerable().SingleOrDefault(x => x.DatabaseID == databaseId)); }
public IEnumerable <T> GetAll() { return(_query.AsEnumerable()); }