public async Task <StatusCodeResult> Post02([FromBody] Ordercreate p) { if (uom == null) { return(new Microsoft.AspNetCore.Mvc.BadRequestResult()); } logger.Trace("add new order in db"); nowtime = System.DateTime.Now; foreach (var a in cm.GetAllemail(p.userEmail)) { var now2 = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt"); UserOrder neworder = new UserOrder(now2, a.userEmail, a.list.ID, a.count, p.pid); uom.AddUserOrder(neworder); //return new StatusCodeResult(201); //created } } cm.DeletebyeEmail(p.userEmail); return(new StatusCodeResult(201)); //created } }
public async Task <StatusCodeResult> Remove2([FromBody] Checkout lego) { email = lego.userEmail; cm.DeletebyeEmail(email); return(new StatusCodeResult(201)); }