public async Task <IActionResult> PutEventSize([FromRoute] int id, [FromBody] EventSize eventSize) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != eventSize.Id) { return(BadRequest()); } _context.Entry(eventSize).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventSizeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public IEnumerable <EventDTO> GetEventsBySize(EventSize eventSize) { return(eventGuestRepo.Query().Include(e => e.Event) .Include(e => e.Guest) .Where(e => e.HasAttended) .GroupBy(e => e.Event) .Where(g => g.Count() < (int)eventSize) .Select(g => new EventDTO().InjectFrom(g.Key) as EventDTO)); }
public DirectInputGenerator(EventSize size) : base(size) { _record = new EVENT_RECORD(); _recordHandle = GCHandle.Alloc(_record, GCHandleType.Pinned); _record.EventHeader.ProviderId = new Guid("3838EF9A-CB6F-4A1C-9033-84C0E8EBF5A7"); _record.EventHeader.EventDescriptor.Id = (ushort)size; _record.UserData = EventData.AddrOfPinnedObject(); _record.UserDataLength = (ushort)Marshal.SizeOf(EventData.Target); }
public DirectInputGenerator(EventSize size) : base(size) { _record = new EVENT_RECORD(); _recordHandle = GCHandle.Alloc(_record, GCHandleType.Pinned); _record.EventHeader.ProviderId = new Guid("3838EF9A-CB6F-4A1C-9033-84C0E8EBF5A7"); _record.EventHeader.EventDescriptor.Id = (ushort)size; _record.UserData = EventData.AddrOfPinnedObject(); _record.UserDataLength = (ushort)Marshal.SizeOf(EventData.Target); }
public async Task <IActionResult> PostEventSize([FromBody] EventSize eventSize) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.EventSize.Add(eventSize); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEventSize", new { id = eventSize.Id }, eventSize)); }
public List <EventDTO> GetEventsBySize(EventSize size) { var eventsBySize = eventGuestRepository.Query().Include(e => e.Event) .Include(e => e.Guest) .Where(e => e.HasAttended) .GroupBy(e => e.Event) .Where(g => g.Count() <= (int)size) .ToList(); return(eventsBySize.Select(g => new EventDTO().InjectFrom(g.Key) as EventDTO) .ToList()); }
public EventWriteInputGenerator(EventSize size) : base(size) { _provider = new EventProvider(new Guid("3838EF9A-CB6F-4A1C-9033-84C0E8EBF5A7")); _descriptor = new EventDescriptor((ushort)size, 0, 0, 4, 0, 0, 1); }
public EventWriteInputGenerator(EventSize size) : base(size) { _provider = new EventProvider(new Guid("3838EF9A-CB6F-4A1C-9033-84C0E8EBF5A7")); _descriptor = new EventDescriptor((ushort)size, 0, 0, 4, 0, 0, 1); }
public InputGenerator(EventSize size) { switch (size) { case EventSize.Small: _eventData = GCHandle.Alloc(new SmallEventStruct { ID = 42 }, GCHandleType.Pinned); break; case EventSize.Medium: { var str = new MediumEventStruct { ID = 42, number1 = 1, number2 = 2, }; for (int i = 0; i < 1023; i++) { str.string1[i] = '1'; str.string2[i] = '2'; } _eventData = GCHandle.Alloc(str, GCHandleType.Pinned); } break; case EventSize.Large: { var str = new LargeEventStruct { ID = 42, number1 = 1, number2 = 2, number3 = 3, number4 = 4, number5 = 5, number6 = 6, number7 = 7, number8 = 8, number9 = 9, number10 = 10, }; for (int i = 0; i < 1023; i++) { str.string1[i] = '1'; str.string2[i] = '2'; str.string3[i] = '3'; str.string4[i] = '4'; str.string5[i] = '5'; str.string6[i] = '6'; str.string7[i] = '7'; str.string8[i] = '8'; str.string9[i] = '9'; str.string10[i] = 'a'; } _eventData = GCHandle.Alloc(str, GCHandleType.Pinned); } break; default: throw new Exception("unknown size"); } }
public InputGenerator(EventSize size) { switch (size) { case EventSize.Small: _eventData = GCHandle.Alloc(new SmallEventStruct { ID = 42 }, GCHandleType.Pinned); break; case EventSize.Medium: { var str = new MediumEventStruct { ID = 42, number1 = 1, number2 = 2, }; for (int i = 0; i < 1023; i++) { str.string1[i] = '1'; str.string2[i] = '2'; } _eventData = GCHandle.Alloc(str, GCHandleType.Pinned); } break; case EventSize.Large: { var str = new LargeEventStruct { ID = 42, number1 = 1, number2 = 2, number3 = 3, number4 = 4, number5 = 5, number6 = 6, number7 = 7, number8 = 8, number9 = 9, number10 = 10, }; for (int i = 0; i < 1023; i++) { str.string1[i] = '1'; str.string2[i] = '2'; str.string3[i] = '3'; str.string4[i] = '4'; str.string5[i] = '5'; str.string6[i] = '6'; str.string7[i] = '7'; str.string8[i] = '8'; str.string9[i] = '9'; str.string10[i] = 'a'; } _eventData = GCHandle.Alloc(str, GCHandleType.Pinned); } break; default: throw new Exception("unknown size"); } }