示例#1
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));
            }
        }
示例#2
0
 public async Task Post([FromBody] Attributtyp attributtyp)
 {
     _context.Attributtyper.Add(attributtyp);
     await _context.SaveChangesAsync();
 }