public async Task <IActionResult> Create(Sector sector) { if (sector == null) { return(BadRequest("Sector not passed")); } var createdSector = await sectorDAO.Create(sector); if (createdSector != null) { return(CreatedAtAction("GetById", "Sector", new { createdSector.Id }, createdSector)); } else { return(BadRequest("Error occured please try again.")); } }
public async Task <IActionResult> Create(House house) { if (house == null) { return(BadRequest("House not passed")); } var createdHouse = await houseDAO.Create(house); if (createdHouse != null) { return(CreatedAtAction("GetById", "House", new { createdHouse.Id }, createdHouse)); } else { return(BadRequest("Error occured please try again.")); } }