public async Task <ActionResult <LocationPrefix> > PostLocationPrefix(LocationPrefix locationPrefix) { _context.LocationPrefixes.Add(locationPrefix); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLocationPrefix", new { id = locationPrefix.Id }, locationPrefix)); }
public async Task <IActionResult> PutLocationPrefix(Guid id, LocationPrefix locationPrefix) { if (id != locationPrefix.Id) { return(BadRequest()); } _context.Entry(locationPrefix).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationPrefixExists(id)) { return(NotFound()); } else { return(StatusCode(StatusCodes.Status500InternalServerError)); } } return(NoContent()); }
public Location(LocationPrefix prefix, string streetName, int streetNumber, string district, string ZIPCode, string complement) { this.prefix = prefix; this.streetName = streetName; this.streetNumber = streetNumber; this.district = district; this.ZIPCode = ZIPCode; this.complement = complement; }
public Location() { prefix = LocationPrefix.Invalid; streetNumber = -1; }