Browse Source

Modify CreatedAtAction parameter, It has an error

pull/223/head
Christian Arenas 7 years ago
parent
commit
dd3237245d
2 changed files with 3 additions and 9 deletions
  1. +0
    -5
      eShopOnContainers-ServicesAndWebApps.sln
  2. +3
    -4
      src/Services/Marketing/Marketing.API/Controllers/LocationsController.cs

+ 0
- 5
eShopOnContainers-ServicesAndWebApps.sln View File

@ -95,11 +95,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Marketing", "Marketing", "{A5260DE0-1FDD-467E-9CC1-A028AB081CEE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Marketing.API", "src\Services\Marketing\Marketing.API\Marketing.API.csproj", "{DF395F85-B010-465D-857A-7EBCC512C0C2}"
ProjectSection(ProjectDependencies) = postProject
{0044B293-1DCC-4224-B948-00CF6DC7F510} = {0044B293-1DCC-4224-B948-00CF6DC7F510}
{22A0F9C1-2D4A-4107-95B7-8459E6688BC5} = {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}
{942ED6E8-0050-495F-A0EA-01E97F63760C} = {942ED6E8-0050-495F-A0EA-01E97F63760C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution


+ 3
- 4
src/Services/Marketing/Marketing.API/Controllers/LocationsController.cs View File

@ -20,8 +20,7 @@ namespace Microsoft.eShopOnContainers.Services.Marketing.API.Controllers
}
[HttpGet]
[Route("api/v1/campaigns/{campaignId:int}/locations/{userLocationRuleId:int}",
Name = "GetLocationByCampaignAndLocationRuleId")]
[Route("api/v1/campaigns/{campaignId:int}/locations/{userLocationRuleId:int}")]
public IActionResult GetLocationByCampaignAndLocationRuleId(int campaignId,
int userLocationRuleId)
{
@ -84,8 +83,8 @@ namespace Microsoft.eShopOnContainers.Services.Marketing.API.Controllers
await _context.Rules.AddAsync(locationRule);
await _context.SaveChangesAsync();
return CreatedAtRoute("GetLocationByCampaignAndLocationRuleId",
new { campaignId = campaignId, locationRuleId = locationRule.Id }, null);
return CreatedAtAction(nameof(GetLocationByCampaignAndLocationRuleId),
new { campaignId = campaignId, userLocationRuleId = locationRule.Id }, null);
}
[HttpDelete]


Loading…
Cancel
Save