Created
October 31, 2018 19:59
-
-
Save jonhilt/9613c064d4ee0fe0626b1d042816a624 to your computer and use it in GitHub Desktop.
This file contains 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 OrderController : Controller { | |
// rest of code omitted | |
public IActionResult ById(string id){ | |
var order = _dataContext.Orders.FirstOrDefault(x=>x.Id == id); | |
if(order == null) { | |
order = new Order(); | |
} | |
return View(order); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment