aspnet / Templates

This repo is OBSOLETE - please see the README file for information
Other
150 stars 57 forks source link

Replace magic action name strings with nameof operator #607

Closed scottaddie closed 8 years ago

scottaddie commented 8 years ago

This PR replaces magic strings being passed as the action name parameters in the Url.Action calls. This will help ensure that as controller action methods are renamed, the Url.Action calls aren't forgotten. It's also consistent with what's already being done in the RedirectToAction calls.

dnfclas commented 8 years ago

Hi @scottaddie, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

peterblazejewicz commented 8 years ago

These are not magic strings IMO. The proposed code is just more technical solution I think, but is not used in documentation or example content: https://github.com/aspnet/MusicStore/blob/19325a6ccecaf24122d19a89502b9fd2342864ac/src/MusicStore/Controllers/AccountController.cs#L163 There are other ways to avoid string literals (we use global store pattern with constants for controllers and actions at work)

phenning commented 8 years ago

Moved to post preview2.