Giter Site home page Giter Site logo

jchadwick / productiveaspnetmvc Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 13.0 459 KB

Exercise files and source code for online training course, ASP.NET MVC: Building Productive and Maintainable applications

C# 88.65% CSS 2.62% ASP 0.08% JavaScript 8.65%
aspnetmvc aspnet asp-net-mvc aspnet-mvc linkedin-learning linkedinlearning lynda-com

productiveaspnetmvc's Introduction

productiveaspnetmvc's People

Contributors

jchadwick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

productiveaspnetmvc's Issues

Error: The trust relationship between this workstation and the primary domain failed

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))

Bugs

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.