public ActionResult <Address> Post([FromBody] Address adr) { //return Ok(AddressDAO.Create(adr)); Address found = AddressDAO.Create(adr); return(found != null ? (ActionResult <Address>)Ok(found) : NotFound("This address is already exist")); }
public Place CreatePlaceAndAddress(PlaceAndAddress place) { Address adr = AddressDAO.Create(place.Address); place.Place.IdAdr = adr.Id; return(PlaceDAO.Create(place.Place)); }
public User CreateUserAndAddress(UserAndAddress user) { Address adr = AddressDAO.Create(user.Address); user.User.Idadr = adr.Id; return(UserDAO.Create(user.User)); }