public List <int> Get(int EventID) { var fillInts = Fillables.CreateFillSimpleType <int>("UserId"); List <SimpleType <int> > containedUserIds = bookedEventsManager.GetCustomQuery(fillInts, "Select BookedEvents.UserId from BookedEvents Inner Join BookingSettings on BookingSettings.UserId = BookedEvents.UserId where BookingSettings.ReceiveMessages = 1 and BookedEvents.EventId = " + EventID); List <int> userIds = new List <int>(containedUserIds.Count); foreach (SimpleType <int> containedUserId in containedUserIds) { userIds.Add(containedUserId.Variable); } return(userIds); }