private static IItem CreateItem(int index) { IItem current = null; switch (index) { case 0: current = new SomeItem(); break; case 1: current = new AnotherItem(); break; case 2: current = new YetAnotherItem(); break; case 3: current = new YetAnotherItem(); break; case 4: current = new YetAnotherItem(); break; } return(current); }
private static IItem MoveNext(int state) { IItem current = null; switch (state) { case 0: current = new SomeItem(); break; case 1: current = new AnotherItem(); break; case 2: current = new YetAnotherItem(); break; case 3: current = new YetAnotherItem(); break; case 4: current = new YetAnotherItem(); break; } return(current); }
public async Task <ActionResult <SomeItem> > PostSomeItem(SomeItem item) { _context.SomeItems.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetSomeItem), new { id = item.Id }, item)); }
public async Task <IActionResult> PutSomeItem(int id, SomeItem item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public void AddItemToControlList(SomeItem item) { this.ControlList.Add(item); }
public MainWindow() { InitializeComponent(); this.item = new SomeItem{Numbers=new[]{7,8,10}, ChosenText="10"}; this.testStackPanel.DataContext = item; }