jchadwick / productiveaspnetmvc Goto Github PK
View Code? Open in Web Editor NEWExercise files and source code for online training course, ASP.NET MVC: Building Productive and Maintainable applications
Exercise files and source code for online training course, ASP.NET MVC: Building Productive and Maintainable applications
When I was working on Chapter 03 Challenge, I got an error saying "The trust relationship between this workstation and the primary domain failed" in _Layout.cshtml line 32.
@if (User.IsInRole(HPlusSports.Models.UserRoles.Admin))
I use Windows 10, Visual Studio 2017 Community Edition and IIS Express when got this error.
From this solution, I found that User.IsInRole seems to throw an exception when Windows.Identity.IsAuthenticated is false. So I use that solution, adding an authentication checking before User.IsInRole.
Below is the solution.
@if (User.Identity.IsAuthenticated && User.IsInRole(HPlusSports.Models.UserRoles.Admin))
In ProductsController (bug introduced in Chapter 4, section 2)
var vm = new ProductsListViewModel { Products = **products**.Select(x => new ProductViewModel { MSRP = x.MSRP, Name = x.Name, Price = x.Price, SKU = x.SKU, Rating = ratings.FirstOrDefault(y => x.SKU == y.SKU), }) };
should be
var vm = new ProductListViewModel { Products = **model**.Select(x => new ProductViewModel { MSRP = x.MSRP, Name = x.Name, Price = x.Price, SKU = x.SKU, Rating = ratings.FirstOrDefault(y => x.SKU == y.SKU) }) }
In AllowPartialRenderingAttribute (bug introduced in Chapter 5, Section 1)
if (request == null) return;
should be
if (result== null) return;
Was going through your course and noticed these two errors. Haven't finished it yet but thanks for the excellent course.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.