public IActionResult Create([FromBody] Car car) { if (car == null) { return(BadRequest()); } _context.Cars.Add(car); _context.SaveChanges(); return(CreatedAtRoute("GetCar", new { id = car.id }, car)); }
public IActionResult Create([FromBody] Image image) { if (image == null) { return(BadRequest()); } _context.Images.Add(image); _context.SaveChanges(); return(CreatedAtRoute("GetImage", new { id = image.id }, image)); }
public IActionResult Create([FromBody] User user) { if (user == null) { return(BadRequest()); } _context.Users.Add(user); _context.SaveChanges(); return(CreatedAtRoute("GetUser", new { id = user.id }, user)); }