public IActionResult AddLocation(Guid memberId,
                                  [FromBody] LocationRecord locationRecord)
 {
     locationRepository.Add(locationRecord);
     return(this.Created(
                $"/locations/{memberId}/{locationRecord.ID}",
                locationRecord));
 }
        public async Task <IActionResult> AddLocation(Guid memberId, [FromBody] LocationRecord locationRecord)
        {
            locationRecord.MemberId = memberId;

            await _locationRepository.Add(locationRecord);

            return(Created(Url.Link("GetLastLocationForMember", new { memberId }), locationRecord));
        }
 public IActionResult AddLocation(Guid memberId, [FromBody] LocationRecord locationRecord)
 {
     if (locationRecord == null)
     {
         return(this.BadRequest($"Error at payload"));
     }
     _repository.Add(locationRecord);
     return(this.Created($"/locations/{memberId}/{locationRecord.ID}", locationRecord));
 }
 public IActionResult AddLocation(Guid memberId, [FromBody] LocationRecord record)
 {
     _locationRecordRepository.Add(record);
     return(Created($"api/locations/{memberId}/{record.ID}", record));
 }
Exemple #5
0
 public ActionResult <LocationRecord> AddLocation(Guid memberId, LocationRecord locationRecord)
 {
     locationRepository.Add(locationRecord);
     return(Created($"locations/{memberId}/{locationRecord.Id}", locationRecord));
 }
Exemple #6
0
 public IActionResult AddLocation(Guid memberId, [FromBody] LocationRecord locationRecord)
 {
     Console.WriteLine("Adding Location");
     locationRepository.Add(locationRecord);
     return(this.Created($"/locations/{memberId}/{locationRecord.ID}", locationRecord));
 }
Exemple #7
0
 public IActionResult AddLocation([FromBody] LocationRecord record, Guid memberId)
 {
     Repository.Add(record);
     return(this.Created($"/locations/{memberId}/{record.ID}", record));
 }
Exemple #8
0
 public LocationRecord AddLocation(LocationRecord record)
 {
     return(repository.Add(record));
 }
 public IActionResult AddLocation(Guid memberId, [FromBody] LocationRecord locationRecord)
 {
     //之所以无法解析Body中的locationRecord,是因为"MemberID"写成了半个单引号,timespan是long类型,写成带小数点也不行滴
     locationRepository.Add(locationRecord);
     return(this.Created($"/locations/{memberId}/{locationRecord.ID}", locationRecord));
 }