Created
January 23, 2019 17:15
-
-
Save davidACash/0de9dbc58a5d219c20b1c98fc7c2d6c0 to your computer and use it in GitHub Desktop.
CWE-915 Solution C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestController : Controller | |
{ | |
[HttpPost] | |
public ActionResult TestMethod([Bind(Include = TestModel.BindProperties)] TestModel testModel) | |
{ | |
// ... | |
} | |
} | |
public class TestModel | |
{ | |
public const string BindProperty = “Name, Description, Amount”; | |
public Guid Id { get; set; } | |
public string Name { get; set; } | |
public string Description { get; set; } | |
public int Amount { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment