public async Task <StatusCodeResult> Put([FromBody] Lapp lapp) { foreach (var attribute in lapp.Attribut) { attribute.AttributtypId = attribute.Attributtyp.AttributtypId; attribute.Attributtyp = null; } lapp.Status = null; _context.Lappar.Update(lapp); if (await _context.SaveChangesAsync() > 0) { return(Ok()); } else { return(StatusCode(500)); } }
public async Task <IActionResult> Post([FromBody] Lapp lapp) { foreach (var attribute in lapp.Attribut) { attribute.AttributtypId = attribute.Attributtyp.AttributtypId; attribute.Attributtyp = null; } lapp.StatusId = 1; _context.Lappar.Add(lapp); if (await _context.SaveChangesAsync() > 0) { return(Ok(lapp.LappId)); } else { return(StatusCode(500)); } }
public async Task SkickaLapp(Lapp lapp) { await Clients.All.SendAsync("HämtaLapp", lapp); }