예제 #1
0
 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));
     }
 }
예제 #2
0
        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));
            }
        }
예제 #3
0
 public async Task SkickaLapp(Lapp lapp)
 {
     await Clients.All.SendAsync("HämtaLapp", lapp);
 }