├── .gitattributes ├── .gitignore ├── CourseWork.md ├── Homework-Git.md ├── Homework-Regex.md ├── LICENSE ├── Lesson 11 - ModelBinding ├── Forms 1 │ ├── WebApplication1.sln │ └── WebApplication1 │ │ ├── App_Start │ │ └── RouteConfig.cs │ │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ ├── Controllers │ │ ├── HomeController.cs │ │ └── UserModel.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ └── modernizr-2.6.2.js │ │ ├── Views │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ ├── _ViewStart.cshtml │ │ └── web.config │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── WebApplication1.csproj │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── packages.config └── Forms │ ├── Forms.sln │ └── Forms │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ └── HomeController.cs │ ├── Forms.csproj │ ├── Global.asax │ ├── Global.asax.cs │ ├── MyModelBinder.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js │ ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Movie │ │ └── Index.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Lesson 12 - Data Validation ├── Validation (Project 2014) │ ├── FormValidation.sln │ ├── FormValidation │ │ ├── App_Start │ │ │ └── RouteConfig.cs │ │ ├── Content │ │ │ ├── css │ │ │ │ ├── reset.css │ │ │ │ └── style.css │ │ │ └── images │ │ │ │ ├── arrow.png │ │ │ │ ├── avatar-comment.png │ │ │ │ ├── avatar.png │ │ │ │ ├── date-article.png │ │ │ │ ├── fc-ico.png │ │ │ │ └── seach-ico.png │ │ ├── Controllers │ │ │ └── HomeController.cs │ │ ├── FormValidation.csproj │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Models │ │ │ ├── AddCommentModel.cs │ │ │ ├── ArticleModel.cs │ │ │ ├── CommentItemModel.cs │ │ │ └── UserModel.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Repository │ │ │ ├── CommentsRepository.cs │ │ │ └── CountriesRepository.cs │ │ ├── Resources │ │ │ ├── DisplayNames.Designer.cs │ │ │ ├── DisplayNames.en.Designer.cs │ │ │ ├── DisplayNames.en.resx │ │ │ ├── DisplayNames.resx │ │ │ ├── ErrorMessages.en.Designer.cs │ │ │ ├── ErrorMessages.en.resx │ │ │ ├── ErrorMessages.resx │ │ │ └── ErrorMessages1.Designer.cs │ │ ├── ValidationAttributes │ │ │ └── MyValidationAttribute.cs │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── AddComment.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ └── _Layout.cshtml │ │ │ ├── Web.config │ │ │ └── _ViewStart.cshtml │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ └── packages.config │ └── help.txt └── Validation (Project 2015) │ ├── ValidationAttributes.sln │ └── ValidationAttributes │ ├── App_Start │ └── RouteConfig.cs │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ └── FormModel.cs │ ├── MyModelBinder.cs │ ├── MyValidationAttribute.cs │ ├── Names.Designer.cs │ ├── Names.resx │ ├── Names.ru.Designer.cs │ ├── Names.ru.resx │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js │ ├── ValidationAttributes.csproj │ ├── ValidationMessages.Designer.cs │ ├── ValidationMessages.resx │ ├── ValidationMessages.ru.resx │ ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Lesson 13 - Temp Storage └── TempStorage (Project 2015) │ ├── TempStorage.sln │ └── TempStorage │ ├── App_Start │ └── RouteConfig.cs │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ └── User.cs │ ├── MyAuthorizationAttribute.cs │ ├── PasswordHashHelper.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js │ ├── TempStorage.csproj │ ├── Views │ ├── Home │ │ ├── CachedPage.cshtml │ │ ├── Index.cshtml │ │ ├── Login.cshtml │ │ ├── ManageAccount.cshtml │ │ └── SessionTest.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Lesson 14 - SQLDatabase └── ADO.NET Connections │ ├── ADO.NET Connections.sln │ ├── ADO.NET Connections │ ├── ADO.NET Connections.csproj │ ├── App_Start │ │ └── RouteConfig.cs │ ├── ApplicationInsights.config │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ ├── Controllers │ │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ │ └── CatEditModel.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ └── modernizr-2.6.2.js │ ├── Service References │ │ └── Application Insights │ │ │ └── ConnectedService.json │ ├── Views │ │ ├── Home │ │ │ ├── Edit.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ ├── _ViewStart.cshtml │ │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── packages.config │ └── UnitTestProject1 │ ├── Properties │ └── AssemblyInfo.cs │ ├── UnitTest1.cs │ └── UnitTestProject1.csproj ├── Lesson 19 - Testing ├── Integration testing │ ├── ASP.NET MVC │ │ ├── HoS_AP.BLL.Tests │ │ │ ├── AccountServiceTests.cs │ │ │ ├── CharacterOperationServiceTests.cs │ │ │ ├── CharacterPresentationServiceTests.cs │ │ │ ├── HoS_AP.BLL.Tests.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ValidationServiceTests.cs │ │ │ └── packages.config │ │ ├── HoS_AP.BLL │ │ │ ├── HoS_AP.BLL.csproj │ │ │ ├── Mappers │ │ │ │ └── CharacterMapper.cs │ │ │ ├── Models │ │ │ │ ├── AuthenticationModel.cs │ │ │ │ ├── CharacterEditModel.cs │ │ │ │ ├── CharacterListItemModel.cs │ │ │ │ └── ValidationResult.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ServiceInterfaces │ │ │ │ ├── EncryptionService.cs │ │ │ │ ├── IAccountService.cs │ │ │ │ ├── ICharacterOperationService.cs │ │ │ │ ├── ICharacterPresentationService.cs │ │ │ │ ├── IEncryptionService.cs │ │ │ │ └── IValidationMessageProvider.cs │ │ │ ├── Services │ │ │ │ ├── AccountService.cs │ │ │ │ ├── CharacterOperationService.cs │ │ │ │ ├── CharacterPresentationService.cs │ │ │ │ └── ValidationMessageProvider.cs │ │ │ ├── Validation │ │ │ │ ├── IValidationService.cs │ │ │ │ ├── ValidationError.cs │ │ │ │ ├── ValidationErrorExtension.cs │ │ │ │ ├── ValidationMessageKeys.cs │ │ │ │ ├── ValidationService.cs │ │ │ │ └── Validators │ │ │ │ │ ├── AuthenticationModelValidator.cs │ │ │ │ │ └── CharacterEditModelValidator.cs │ │ │ └── packages.config │ │ ├── HoS_AP.DAL │ │ │ ├── Dao │ │ │ │ ├── AccountDao.cs │ │ │ │ ├── CharacterDao.cs │ │ │ │ └── FileSystemRepository.cs │ │ │ ├── DaoInterfaces │ │ │ │ ├── IAccountDao.cs │ │ │ │ └── ICharacterDao.cs │ │ │ ├── Dto │ │ │ │ ├── Account.cs │ │ │ │ ├── BaseDto.cs │ │ │ │ └── Character.cs │ │ │ ├── HoS_AP.DAL.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Repository │ │ │ │ ├── GenericRepository.cs │ │ │ │ └── IGenericRepository.cs │ │ │ └── packages.config │ │ ├── HoS_AP.DI │ │ │ ├── DryIoc │ │ │ │ ├── AsyncExecutionFlowScopeContext.cs │ │ │ │ ├── Container.cs │ │ │ │ ├── FactoryCompiler.cs │ │ │ │ └── ImTools.cs │ │ │ ├── HoS_AP.DI.csproj │ │ │ ├── IOC.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ ├── HoS_AP.Misc │ │ │ ├── CharacterTypes.cs │ │ │ ├── HoS_AP.Misc.csproj │ │ │ ├── IInversionOfControlContainer.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── packages.config │ │ ├── HoS_AP.Web.Tests │ │ │ ├── App.config │ │ │ ├── Constants.cs │ │ │ ├── DeleporterHelpers │ │ │ │ ├── DriverFactory.cs │ │ │ │ ├── NinjectControllerFactoryUtils.cs │ │ │ │ ├── ReadMe.text │ │ │ │ ├── SelfHostExample.cs │ │ │ │ ├── SelfHostSampleTestBase.cs │ │ │ │ ├── SelfHostSeleniumExample.cs │ │ │ │ ├── SelfHostSeleniumSampleTestBase.cs │ │ │ │ └── TidyupUtils.cs │ │ │ ├── DeleporterMockStateAdapter.cs │ │ │ ├── Feature_1.feature │ │ │ ├── Feature_1.feature.cs │ │ │ ├── Feature_2.feature │ │ │ ├── Feature_2.feature.cs │ │ │ ├── Feature_3.feature │ │ │ ├── Feature_3.feature.cs │ │ │ ├── Feature_4.feature │ │ │ ├── Feature_4.feature.cs │ │ │ ├── Feature_5.feature │ │ │ ├── Feature_5.feature.cs │ │ │ ├── Feature_6.feature │ │ │ ├── Feature_6.feature.cs │ │ │ ├── Feature_7.feature │ │ │ ├── Feature_7.feature.cs │ │ │ ├── HoS_AP.Web.Tests.csproj │ │ │ ├── IEDriverServer.exe │ │ │ ├── IStateAdapter.cs │ │ │ ├── JsonFileStateAdapter.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Steps.cs │ │ │ ├── TestRunConfiguration.cs │ │ │ ├── UrlManager.cs │ │ │ ├── UserManager.cs │ │ │ └── packages.config │ │ ├── HoS_AP.Web │ │ │ ├── Content │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ ├── bootstrap.min.css.map │ │ │ │ └── custom.css │ │ │ ├── Controllers │ │ │ │ ├── AccountController.cs │ │ │ │ └── CharacterController.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── HoS_AP.Web.csproj │ │ │ ├── ModelErrorExtension.cs │ │ │ ├── MyControllerFactory.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Scripts │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── jquery-1.9.1.intellisense.js │ │ │ │ ├── jquery-1.9.1.js │ │ │ │ ├── jquery-1.9.1.min.js │ │ │ │ └── jquery-1.9.1.min.map │ │ │ ├── Views │ │ │ │ ├── Account │ │ │ │ │ └── Login.cshtml │ │ │ │ ├── Character │ │ │ │ │ ├── Add.cshtml │ │ │ │ │ ├── Edit.cshtml │ │ │ │ │ ├── Index.cshtml │ │ │ │ │ └── _CharacterEditControls.cshtml │ │ │ │ ├── Shared │ │ │ │ │ ├── _Layout.cshtml │ │ │ │ │ └── _LoginPartial.cshtml │ │ │ │ ├── Web.config │ │ │ │ └── _ViewStart.cshtml │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── log.txt │ │ │ ├── mvcdomainlog.txt │ │ │ └── packages.config │ │ └── HoS_AP.sln │ └── ASP.NET Web.API │ │ ├── Web.Api.ControllerTests │ │ ├── HomeControllerTests.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Web.Api.ControllerTests.csproj │ │ ├── app.config │ │ └── packages.config │ │ ├── Web.Api.InMemoryTests │ │ ├── HomeControllerInMemoryTests.cs │ │ ├── IntegrationTests │ │ │ ├── InMemoryHttpContentSerializationHandler.cs │ │ │ └── InMemoryServer.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Web.Api.InMemoryTests.csproj │ │ ├── app.config │ │ └── packages.config │ │ ├── Web.Api.JMeterTests │ │ ├── JMeterIntegrationTests.cs │ │ ├── MyWebApi.cs │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Settings.Designer.cs │ │ │ └── Settings.settings │ │ ├── Web.Api.JMeterTests.csproj │ │ ├── app.config │ │ ├── config.csv │ │ ├── jMeterResultXmlClasses.cs │ │ ├── packages.config │ │ └── tests.jmx │ │ ├── Web.Api.OwinTests │ │ ├── HomeControllerOwinTests.cs │ │ ├── MyWebApi.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Web.Api.OwinTests.csproj │ │ ├── app.config │ │ └── packages.config │ │ ├── Web.Api.SelfHostedTests │ │ ├── HomeControllerSelfHostedTests.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SelfHostedServer.cs │ │ ├── Web.Api.SelfHostedTests.csproj │ │ ├── app.config │ │ └── packages.config │ │ ├── Web.Api.sln │ │ └── Web.Api │ │ ├── ApplicationInsights.config │ │ ├── Configuration │ │ ├── HttpServerConfiguration.cs │ │ ├── MyDependencyScope.cs │ │ └── MyRependencyResolver.cs │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── IoC │ │ ├── IInversionOfControlContainer.cs │ │ └── SimpleIocContainer.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Services │ │ ├── IService.cs │ │ └── Service.cs │ │ ├── Web.Api.csproj │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ └── packages.config └── Unit testing │ └── WebApp │ ├── WebApp.Tests │ ├── PresentationServiceTests.cs │ ├── ProductTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── WebApp.Tests.csproj │ └── packages.config │ ├── WebApp.sln │ └── WebApp │ ├── App_Start │ └── RouteConfig.cs │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── ICurrentCountryProvider.cs │ ├── IProductPresentationService.cs │ ├── ITaxesProvider.cs │ ├── Models │ └── Product.cs │ ├── ProductPresentationService.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2-vsdoc.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js │ ├── Service References │ └── Application Insights │ │ └── ConnectedService.json │ ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── WebApp.csproj │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Lesson 3 - CSS ├── Linked CSS │ ├── index.html │ ├── index1.html │ └── stylesheet.css └── Undress to impress │ ├── index.html │ └── stylesheet.css ├── Lesson 6 - IDE and Tools ├── Lesson 6.sln └── SimpleWebApp │ ├── App_Start │ └── RouteConfig.cs │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ ├── Category.cs │ ├── CategoryProvider.cs │ ├── Dress.cs │ └── Product.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── SimpleWebApp.csproj │ ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ ├── Category.cshtml │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── packages.config ├── Lesson 8 - ASP.NET MVC Framework ├── Homework.md ├── MeetMvcFramework │ ├── MeetMvcFramework.sln │ └── MeetMvcFramework │ │ ├── App_Start │ │ └── RouteConfig.cs │ │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── MeetMvcFramework.csproj │ │ ├── Models │ │ ├── Cat.cs │ │ └── Dog.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ └── modernizr-2.6.2.js │ │ ├── Views │ │ ├── Home │ │ │ ├── Dog.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── _Green.cshtml │ │ │ └── _Layout.cshtml │ │ ├── _ViewStart.cshtml │ │ └── web.config │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── packages.config └── Views (2017.01.05) │ ├── Blog.sln │ └── Blog │ ├── App_Start │ └── RouteConfig.cs │ ├── ApplicationInsights.config │ ├── Blog.csproj │ ├── Content │ ├── Site.css │ ├── bootstrap.css │ └── bootstrap.min.css │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ └── PageModel.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Index2.cshtml │ ├── Shared │ │ ├── Contact.cshtml │ │ ├── _Layout.cshtml │ │ └── _Layout2.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Lesson 9 - Routes ├── Blog (2017.01.26) │ ├── Blog.sln │ └── Blog │ │ ├── App_Start │ │ └── RouteConfig.cs │ │ ├── ApplicationInsights.config │ │ ├── Blog.csproj │ │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ ├── Controllers │ │ ├── ArticleController.cs │ │ └── HomeController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Models │ │ └── PageModel.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ └── modernizr-2.6.2.js │ │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Index2.cshtml │ │ ├── Shared │ │ │ ├── Contact.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _Layout2.cshtml │ │ ├── _ViewStart.cshtml │ │ └── web.config │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── packages.config └── MvcApplication │ ├── MvcApplication.sln │ └── MvcApplication │ ├── App_Start │ └── RouteConfig.cs │ ├── Controllers │ ├── HomeController.cs │ └── ProductController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── MvcApplication.csproj │ ├── Properties │ └── AssemblyInfo.cs │ ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Product │ │ ├── Details.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap.css │ ├── bootstrap.css.map │ └── bootstrap.min.css │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ └── packages.config ├── LessonsPlan.md ├── MovieProject ├── MovieProject.sln └── MovieProject │ ├── App_Start │ └── RouteConfig.cs │ ├── Controllers │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ ├── IndexModel.cs │ ├── Mpaa.cs │ └── Top1MovieModel.cs │ ├── MovieProject.csproj │ ├── Properties │ └── AssemblyInfo.cs │ ├── Views │ ├── Home │ │ ├── Error404.cshtml │ │ ├── Index.cshtml │ │ └── Reviews.cshtml │ ├── Shared │ │ ├── Footer.cshtml │ │ ├── Header.cshtml │ │ └── _Layout.cshtml │ ├── _ViewStart.cshtml │ └── web.config │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── css │ ├── bootstrap.css │ ├── popuo-box.css │ └── style.css │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ ├── images │ ├── beauty.jpg │ ├── dot.png │ ├── eye-brow.jpg │ ├── f1.jpg │ ├── f2.jpg │ ├── f3.jpg │ ├── f4.jpg │ ├── f5.jpg │ ├── f6.jpg │ ├── gridallbum1.jpg │ ├── gridallbum10.jpg │ ├── gridallbum11.jpg │ ├── gridallbum2.jpg │ ├── gridallbum3.jpg │ ├── gridallbum4.jpg │ ├── gridallbum5.jpg │ ├── gridallbum6.jpg │ ├── gridallbum7.jpg │ ├── gridallbum8.jpg │ ├── gridallbum9.jpg │ ├── header-bg.jpg │ ├── img-sprite.png │ ├── likes.png │ ├── link.png │ ├── logo.png │ ├── m1.jpg │ ├── m2.jpg │ ├── m3.jpg │ ├── m4.jpg │ ├── mi.jpg │ ├── mi1.jpg │ ├── mi2.jpg │ ├── mi3.jpg │ ├── r1.jpg │ ├── r2.jpg │ ├── r3.jpg │ ├── r4.jpg │ ├── r5.jpg │ ├── r6.jpg │ ├── sprit-1.png │ ├── stylish.jpg │ └── views.png │ ├── js │ ├── jquery.flexisel.js │ ├── jquery.magnific-popup.js │ └── jquery.min.js │ └── packages.config └── README.md /CourseWork.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/CourseWork.md -------------------------------------------------------------------------------- /Homework-Regex.md: -------------------------------------------------------------------------------- 1 | **Напишите регулярное выражения для поиска многоточий: трёх или более точек 2 | подряд.** 3 | 4 | *Input*: “Привет!... Как дела?.....” 5 | 6 | *Output*: “..., .....” 7 | 8 |   9 | 10 | **Напишите регулярное выражение для поиска HTML-цвета, заданного как \#ABCDEF, 11 | то есть \# и содержит затем 6 шестнадцатеричных символов.** 12 | 13 | *Input*: “color:\#121212; background-color:\#AA00ef bad-colors:f\#fddee \#fd2” 14 | 15 | *Output*: “\#121212,\#AA00ef” 16 | 17 |   18 | 19 | **Напишите регулярное выражение, которое ищет все числа, в том числе и с 20 | десятичной точкой, в том числе и отрицательные.** 21 | 22 | *Input*: “-1.5 0 2 -123.4.” 23 | 24 | *Output*: “-1.5, 0, 2, -123.4” 25 | 26 |   27 | 28 | http://regex.alf.nu/3 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alexander Panfilenok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1\WebApplication1.csproj", "{E47FE8C3-6432-4526-A5C1-C2F5CA3A5B1E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E47FE8C3-6432-4526-A5C1-C2F5CA3A5B1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E47FE8C3-6432-4526-A5C1-C2F5CA3A5B1E}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E47FE8C3-6432-4526-A5C1-C2F5CA3A5B1E}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E47FE8C3-6432-4526-A5C1-C2F5CA3A5B1E}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace WebApplication1 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | using WebApplication1.Models; 8 | 9 | namespace WebApplication1.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | [HttpGet] 14 | public ActionResult Index() 15 | { 16 | /// Get From Database 17 | var model = new UserModel(); 18 | model.UserName = "Alex"; 19 | model.Password = "123456"; 20 | model.City = "Minsk"; 21 | 22 | FillCities(model); 23 | 24 | return View(model); 25 | } 26 | 27 | [HttpPost] 28 | public ActionResult Index(UserModel model) 29 | { 30 | /// Save To Database 31 | return RedirectToAction("Index"); 32 | FillCities(model); 33 | return View(model); 34 | } 35 | 36 | private void FillCities(UserModel model) 37 | { 38 | model.Cities = new Collection(); 39 | model.Cities.Add("Gomel"); 40 | model.Cities.Add("Minsk"); 41 | model.Cities.Add("Grodno"); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Controllers/UserModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace WebApplication1.Models 4 | { 5 | public class UserModel 6 | { 7 | public string UserName { get; set; } 8 | public string Password { get; set; } 9 | public string City { get; set; } 10 | public Collection Cities { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication1.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace WebApplication1 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 | @using System.Collections.ObjectModel 7 | @model WebApplication1.Models.UserModel 8 | 9 |

Index

10 | 11 |
12 | @Html.TextBoxFor(x => x.UserName) 13 | @Html.PasswordFor(m => m.Password) 14 | @Html.DropDownListFor(m => m.City, Model.Cities.Select(x => new SelectListItem() {Text = x})) 15 | 16 |
-------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms 1/WebApplication1/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms 1/WebApplication1/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Forms", "Forms\Forms.csproj", "{2EDBD0BC-6667-45E1-B368-FB4154971E6F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2EDBD0BC-6667-45E1-B368-FB4154971E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2EDBD0BC-6667-45E1-B368-FB4154971E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2EDBD0BC-6667-45E1-B368-FB4154971E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2EDBD0BC-6667-45E1-B368-FB4154971E6F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Forms.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Forms 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteTable.Routes.MapMvcAttributeRoutes(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Forms.Controllers.FormModel 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |
7 | @Html.TextBoxFor(m => m.user.name)
8 | @Html.DropDownListFor(m => m.selectedOption, Model.AvailableOptions.Select(o => new SelectListItem() { Text = o }))
9 |
10 |
11 |
12 |
13 |
14 |
15 |
-------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Views/Movie/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Index

7 | 8 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 11 - ModelBinding/Forms/Forms/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 11 - ModelBinding/Forms/Forms/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormValidation", "FormValidation\FormValidation.csproj", "{DB2EC89A-B7BF-4913-AC1C-D4E90AE3A982}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DB2EC89A-B7BF-4913-AC1C-D4E90AE3A982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DB2EC89A-B7BF-4913-AC1C-D4E90AE3A982}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DB2EC89A-B7BF-4913-AC1C-D4E90AE3A982}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DB2EC89A-B7BF-4913-AC1C-D4E90AE3A982}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace FormValidation 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection Routes) 9 | { 10 | Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | Routes.MapRoute("Default", "{controller}/{action}/{id}", 13 | new {controller = "Home", action = "Index", id = UrlParameter.Optional} 14 | ); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/arrow.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/avatar-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/avatar-comment.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/avatar.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/date-article.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/date-article.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/fc-ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/fc-ico.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/seach-ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Content/images/seach-ico.png -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using FormValidation.Models; 3 | using FormValidation.Repository; 4 | 5 | namespace FormValidation.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | [HttpGet] 10 | public ActionResult Index() 11 | { 12 | return View(new ArticleModel()); 13 | } 14 | 15 | [HttpPost] 16 | [ValidateInput(false)] 17 | public ActionResult Index(ArticleModel model) 18 | { 19 | if (model.NewComment != null && ModelState.IsValid) 20 | { 21 | CommentsRepository.Comments.Add(model.NewComment.Comment); 22 | return View(new ArticleModel()); 23 | } 24 | 25 | return View(model); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="FormValidation.MvcApplication" Language="C#" %> -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Routing; 3 | 4 | namespace FormValidation 5 | { 6 | public class MvcApplication : HttpApplication 7 | { 8 | protected void Application_Start() 9 | { 10 | RouteConfig.RegisterRoutes(RouteTable.Routes); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Models/AddCommentModel.cs: -------------------------------------------------------------------------------- 1 |  2 | using FormValidation.Resources; 3 | using FormValidation.ValidationAttributes; 4 | using System.ComponentModel.DataAnnotations; 5 | namespace FormValidation.Models 6 | { 7 | public class AddCommentModel 8 | { 9 | [Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "RequiredTemplate")] 10 | [Display(ResourceType = typeof(DisplayNames), Name = "Comment")] 11 | [StringLength(10)] 12 | [RegularExpression(@"[a-zа-я]+")] 13 | public string Comment { get; set; } 14 | 15 | [MyValidationAttribute] 16 | public int Age { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Models/ArticleModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using FormValidation.Repository; 3 | 4 | namespace FormValidation.Models 5 | { 6 | public class ArticleModel 7 | { 8 | public ICollection Comments 9 | { 10 | get { return CommentsRepository.Comments; } 11 | } 12 | 13 | public AddCommentModel NewComment { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Models/CommentItemModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FormValidation.Models 4 | { 5 | public class CommentItemModel 6 | { 7 | public CommentItemModel() 8 | { 9 | Username = "Alex"; 10 | Body = "Comment"; 11 | Date = DateTime.Now; 12 | } 13 | 14 | public string Username { get; set; } 15 | public string Body { get; set; } 16 | public DateTime Date { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Models/UserModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Web; 3 | using FormValidation.Repository; 4 | 5 | namespace FormValidation.Models 6 | { 7 | public class UserModel 8 | { 9 | public ICollection Countries 10 | { 11 | get { return CountriesRepository.Countries; } 12 | } 13 | 14 | public HttpPostedFileWrapper Avatar { get; set; } 15 | 16 | public string Country { get; set; } 17 | 18 | public int Age { get; set; } 19 | 20 | public string Username { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Repository/CommentsRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace FormValidation.Repository 5 | { 6 | public static class CommentsRepository 7 | { 8 | public static readonly ICollection Comments = new Collection(); 9 | } 10 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Repository/CountriesRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace FormValidation.Repository 5 | { 6 | public static class CountriesRepository 7 | { 8 | public static readonly ICollection Countries = 9 | new Collection {"Russia", "Belarus", "Ukraine"}; 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Resources/DisplayNames.en.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Resources/DisplayNames.en.Designer.cs -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Resources/ErrorMessages.en.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Resources/ErrorMessages.en.Designer.cs -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/ValidationAttributes/MyValidationAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using FormValidation.Models; 3 | using FormValidation.Resources; 4 | 5 | namespace FormValidation.ValidationAttributes 6 | { 7 | public class MyValidationAttribute : ValidationAttribute 8 | { 9 | //public override bool IsValid(object value) 10 | //{ 11 | // var age = (int)value; 12 | // return age > 0; 13 | //} 14 | 15 | protected override ValidationResult IsValid(object value, ValidationContext validationContext) 16 | { 17 | var model = validationContext.ObjectInstance as AddCommentModel; 18 | if (model == null) 19 | { 20 | return new ValidationResult("Validation Failed"); 21 | } 22 | 23 | if (model.Age < 1) 24 | { 25 | return new ValidationResult(ErrorMessages.InvalidAge); 26 | } 27 | 28 | return ValidationResult.Success; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Views/Home/AddComment.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | @model FormValidation.Models.ArticleModel 5 |
6 | @Html.ValidationSummary() 7 |
8 | @Html.ValidationMessageFor(m => m.NewComment.Comment) 9 | @Html.TextAreaFor(m => m.NewComment.Comment, new { placeholder = "Your comment", @class = "txt-area" }) 10 | @Html.ValidationMessageFor(m => m.NewComment.Age) 11 | @Html.TextBoxFor(m => m.NewComment.Age) 12 |
13 | 14 | 15 |

Lorem ipsum dolor sit amet, adipiscing

16 |
17 |
18 |
-------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/FormValidation/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2014)/help.txt: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using FormValidation.Resources; 3 | 4 | namespace FormValidation.Models 5 | { 6 | public class AddCommentModel 7 | { 8 | [Display(Name = "Comment", ResourceType = typeof(DisplayNames))] 9 | [Required(ErrorMessageResourceName = "RequiredTemplate", ErrorMessageResourceType = typeof(ErrorMessages))] 10 | [StringLength(4)] 11 | [RegularExpression(@"\d+")] 12 | public string Comment { get; set; } 13 | 14 | [Range(0, 50)] 15 | public int Age { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValidationAttributes", "ValidationAttributes\ValidationAttributes.csproj", "{204ED390-9414-4E18-B028-557E20FFE094}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {204ED390-9414-4E18-B028-557E20FFE094}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {204ED390-9414-4E18-B028-557E20FFE094}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {204ED390-9414-4E18-B028-557E20FFE094}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {204ED390-9414-4E18-B028-557E20FFE094}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ValidationAttributes 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using ValidationAttributes.Models; 3 | 4 | namespace ValidationAttributes.Controllers 5 | { 6 | public class HomeController : Controller 7 | { 8 | [HttpGet] 9 | public ActionResult Index() 10 | { 11 | return View(new FormModel()); 12 | } 13 | 14 | [HttpPost] 15 | public ActionResult Index([ModelBinder(typeof(MyModelBinder))] FormModel model) 16 | { 17 | //ModelState.AddModelError("UserName", "User Name is not valid!"); 18 | if (ModelState.IsValid) 19 | { 20 | return Redirect("Http://google.com"); 21 | } 22 | 23 | return View(model); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ValidationAttributes.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ValidationAttributes 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Models/FormModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | 5 | namespace ValidationAttributes.Models 6 | { 7 | public class FormModel 8 | { 9 | //[Display(ResourceType = typeof(Names), Name = "UserName")] 10 | //[Required(ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "UserNameRequired")] 11 | //[StringLength(4, ErrorMessageResourceType = typeof(ValidationMessages), ErrorMessageResourceName = "UserNameMaxLength")] 12 | [Required] 13 | [StringLength(4)] 14 | public string UserName { get; set; } 15 | 16 | [RegularExpression("[a-zA-Z0-9]+")] 17 | public string Password { get; set; } 18 | 19 | [Compare("Password")] 20 | public string ConfirmPassword { get; set; } 21 | 22 | [MyValidation] 23 | public string City { get; set; } 24 | 25 | public bool RememberMe { get; set; } 26 | 27 | public IEnumerable Cities 28 | { 29 | get 30 | { 31 | return new[] { "Minsk", "Grodno", "Gomel" }; 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/MyValidationAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.Web.Mvc; 3 | using ValidationAttributes.Models; 4 | 5 | namespace ValidationAttributes 6 | { 7 | public class MyValidationAttribute : ValidationAttribute 8 | { 9 | public override bool IsValid(object value) 10 | { 11 | var str = value as string; 12 | if (str != null && !str.StartsWith("M")) 13 | { 14 | return false; 15 | } 16 | 17 | return true; 18 | } 19 | 20 | protected override ValidationResult IsValid(object value, ValidationContext validationContext) 21 | { 22 | var model = validationContext.ObjectInstance as FormModel; 23 | if (model != null && model.UserName != null) 24 | { 25 | return ValidationResult.Success; 26 | } 27 | 28 | return base.IsValid(value, validationContext); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Names.ru.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Names.ru.Designer.cs -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 12 - Data Validation/Validation (Project 2015)/ValidationAttributes/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TempStorage", "TempStorage\TempStorage.csproj", "{DB8A6272-66D8-4F04-8528-CECEC23C34C0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DB8A6272-66D8-4F04-8528-CECEC23C34C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DB8A6272-66D8-4F04-8528-CECEC23C34C0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DB8A6272-66D8-4F04-8528-CECEC23C34C0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DB8A6272-66D8-4F04-8528-CECEC23C34C0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace TempStorage 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="TempStorage.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace TempStorage 5 | { 6 | public class MvcApplication : System.Web.HttpApplication 7 | { 8 | protected void Application_Start() 9 | { 10 | AreaRegistration.RegisterAllAreas(); 11 | RouteConfig.RegisterRoutes(RouteTable.Routes); 12 | } 13 | 14 | protected void Session_OnStart() 15 | { 16 | 17 | } 18 | 19 | protected void Session_OnEnd() 20 | { 21 | 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace TempStorage.Models 7 | { 8 | [Serializable] 9 | public class User 10 | { 11 | public string Name { get; set; } 12 | 13 | public Address address { get; set; } 14 | 15 | } 16 | 17 | [Serializable] 18 | public class Address 19 | { 20 | private string street { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/MyAuthorizationAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace TempStorage 5 | { 6 | public class MyAuthorizationAttribute : AuthorizeAttribute 7 | { 8 | protected override bool AuthorizeCore(HttpContextBase httpContext) 9 | { 10 | var user = httpContext.User.Identity.IsAuthenticated ? httpContext.User.Identity.Name : null; 11 | if (user != null) 12 | { 13 | // check permission in database 14 | } 15 | 16 | return false; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/Home/CachedPage.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "CachedPage"; 4 | } 5 | 6 |

CachedPage

7 |

@DateTime.Now

-------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Collections.ObjectModel 2 | 3 | @{ 4 | var items = Session["MySession"] as Collection; 5 | string values = null; 6 | if (items != null) 7 | { 8 | values = string.Join(", ", items); 9 | } 10 | } 11 | 12 |

Index

13 | 14 |
@values
15 | -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/Home/Login.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | string username = null; 3 | if (User.Identity.IsAuthenticated) 4 | { 5 | username = User.Identity.Name; 6 | } 7 | } 8 | 9 |

Login

10 |

11 | @if (username != null) 12 | { 13 | @:Hello @username 14 | } 15 |

16 |
17 | 18 | 19 | 20 |
-------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/Home/ManageAccount.cshtml: -------------------------------------------------------------------------------- 1 | 

Secured Area

-------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/Home/SessionTest.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Session"; 4 | } 5 | 6 |

Session

-------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 13 - Temp Storage/TempStorage (Project 2015)/TempStorage/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ADO.NET_Connections 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ADO.NET_Connections.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ADO.NET_Connections 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Models/CatEditModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace ADO.NET_Connections.Models 7 | { 8 | public class CatEditModel 9 | { 10 | public int Id { get; set; } 11 | public string Name { get; set; } 12 | public string Owner { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Service References/Application Insights/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider", 3 | "Version": "7.18.214.2", 4 | "GettingStartedDocument": { 5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=613413" 6 | } 7 | } -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Views/Home/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model ADO.NET_Connections.Models.CatEditModel 2 | @{ 3 | ViewBag.Title = "Edit"; 4 | } 5 | 6 |

Edit

7 | 8 |
9 | @Html.HiddenFor(m => m.Id) 10 | @Html.LabelFor(m => m.Name) 11 | @Html.TextBoxFor(m => m.Name) 12 |
13 | @Html.LabelFor(m => m.Owner) 14 | @Html.TextBoxFor(m => m.Owner) 15 | 16 |
-------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model List 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Index

7 | 8 | @foreach (var name in Model) 9 | { 10 |
@name
11 | } -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 14 - SQLDatabase/ADO.NET Connections/ADO.NET Connections/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 14 - SQLDatabase/ADO.NET Connections/UnitTestProject1/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SqlClient; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace UnitTestProject1 7 | { 8 | [TestClass] 9 | public class UnitTest1 10 | { 11 | [TestMethod] 12 | public void TestMethod1() 13 | { 14 | string owner = null; 15 | List model = new List(); 16 | string connectionString = "Data Source=PANFILENOKA\\SQLEXPRESS;Initial Catalog=Webinar2017;User ID=default;Password=default"; 17 | 18 | SqlConnection connection = new SqlConnection(connectionString); 19 | connection.Open(); 20 | 21 | SqlCommand command = new SqlCommand("select * from Cat where owner = @owner", connection); 22 | command.Parameters.AddWithValue("@owner", owner); 23 | SqlDataReader dataReader = command.ExecuteReader(); 24 | while (dataReader.Read()) 25 | { 26 | model.Add((string)dataReader["Name"]); 27 | } 28 | 29 | dataReader.Close(); 30 | connection.Close(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Mappers/CharacterMapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HoS_AP.BLL.Models; 3 | using HoS_AP.DAL.Dto; 4 | 5 | namespace HoS_AP.BLL.Mappers 6 | { 7 | internal static class CharacterMapper 8 | { 9 | internal static void MapTo(this CharacterEditModel model, ref Character entity) 10 | { 11 | if (model.Id == Guid.Empty) 12 | { 13 | entity.Id = Guid.NewGuid(); 14 | entity.Created = DateTime.Now; 15 | } 16 | 17 | entity.Name = model.Name; 18 | entity.Price = model.Price; 19 | entity.Type = model.Type; 20 | entity.Active = model.Active; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Models/AuthenticationModel.cs: -------------------------------------------------------------------------------- 1 | namespace HoS_AP.BLL.Models 2 | { 3 | public class AuthenticationModel 4 | { 5 | public string UserName { get; set; } 6 | 7 | public string Password { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Models/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | using HoS_AP.BLL.Validation; 5 | 6 | namespace HoS_AP.BLL.Models 7 | { 8 | public class ValidationResult 9 | { 10 | internal ValidationResult(string property, string message) 11 | { 12 | Errors = new Collection { new ValidationError(property, message)}; 13 | } 14 | 15 | internal ValidationResult(ICollection errors) 16 | { 17 | Errors = errors; 18 | } 19 | 20 | public ICollection Errors { get; private set; } 21 | 22 | public bool IsValid 23 | { 24 | get { return Errors == null || !Errors.Any(); } 25 | } 26 | 27 | public static ValidationResult Ok 28 | { 29 | get 30 | { 31 | return new ValidationResult(null); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/ServiceInterfaces/IAccountService.cs: -------------------------------------------------------------------------------- 1 | using HoS_AP.BLL.Models; 2 | 3 | namespace HoS_AP.BLL.ServiceInterfaces 4 | { 5 | public interface IAccountService 6 | { 7 | ValidationResult Authenticate(AuthenticationModel model); 8 | } 9 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/ServiceInterfaces/ICharacterOperationService.cs: -------------------------------------------------------------------------------- 1 | using HoS_AP.BLL.Models; 2 | 3 | namespace HoS_AP.BLL.ServiceInterfaces 4 | { 5 | public interface ICharacterOperationService 6 | { 7 | ValidationResult Save(CharacterEditModel model); 8 | void Delete(string name); 9 | void Recover(string name); 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/ServiceInterfaces/ICharacterPresentationService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HoS_AP.BLL.Models; 3 | 4 | namespace HoS_AP.BLL.ServiceInterfaces 5 | { 6 | public interface ICharacterPresentationService 7 | { 8 | ICollection List(); 9 | CharacterEditModel Load(string name); 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/ServiceInterfaces/IEncryptionService.cs: -------------------------------------------------------------------------------- 1 | namespace HoS_AP.BLL.ServiceInterfaces 2 | { 3 | internal interface IEncryptionService 4 | { 5 | bool IsValidPassword(string password, string correctHash); 6 | } 7 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/ServiceInterfaces/IValidationMessageProvider.cs: -------------------------------------------------------------------------------- 1 | using HoS_AP.BLL.Validation; 2 | 3 | namespace HoS_AP.BLL.ServiceInterfaces 4 | { 5 | internal interface IValidationMessageProvider 6 | { 7 | string Get(ValidationMessageKeys key); 8 | } 9 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Services/CharacterPresentationService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using HoS_AP.BLL.Models; 4 | using HoS_AP.BLL.ServiceInterfaces; 5 | using HoS_AP.DAL.DaoInterfaces; 6 | 7 | namespace HoS_AP.BLL.Services 8 | { 9 | internal class CharacterPresentationService : ICharacterPresentationService 10 | { 11 | private readonly ICharacterDao characterDao; 12 | 13 | public CharacterPresentationService(ICharacterDao characterDao) 14 | { 15 | this.characterDao = characterDao; 16 | } 17 | 18 | ICollection ICharacterPresentationService.List() 19 | { 20 | return characterDao.Load().Select(x => new CharacterListItemModel(x)).ToList(); 21 | } 22 | 23 | CharacterEditModel ICharacterPresentationService.Load(string name) 24 | { 25 | var character = characterDao.Load(name); 26 | if (character == null) return null; 27 | return new CharacterEditModel(character); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/IValidationService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HoS_AP.BLL.Models; 3 | 4 | namespace HoS_AP.BLL.Validation 5 | { 6 | internal interface IValidationService 7 | { 8 | ICollection Validate(AuthenticationModel model); 9 | 10 | ICollection Validate(CharacterEditModel model); 11 | } 12 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/ValidationError.cs: -------------------------------------------------------------------------------- 1 | namespace HoS_AP.BLL.Validation 2 | { 3 | public class ValidationError 4 | { 5 | private readonly string property, message; 6 | 7 | public ValidationError(string property, string errorMessage) 8 | { 9 | this.property = property; 10 | this.message = errorMessage; 11 | } 12 | 13 | public string Property { get { return property; } } 14 | 15 | public string Message { get { return message; } } 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/ValidationErrorExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using FluentValidation.Results; 4 | 5 | namespace HoS_AP.BLL.Validation 6 | { 7 | internal static class ValidationErrorExtensions 8 | { 9 | public static ICollection ToValidationResultItem(this IEnumerable failures) 10 | { 11 | var result = new Collection(); 12 | if (failures == null) 13 | { 14 | return result; 15 | } 16 | 17 | foreach (var failure in failures) 18 | { 19 | result.Add(new ValidationError(failure.PropertyName, failure.ErrorMessage)); 20 | } 21 | 22 | return result; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/ValidationMessageKeys.cs: -------------------------------------------------------------------------------- 1 | namespace HoS_AP.BLL.Validation 2 | { 3 | internal enum ValidationMessageKeys 4 | { 5 | Authentication_UserName_Required, 6 | Authentication_Password_Required, 7 | Authentication_Invalid_Credentials, 8 | CharacterEdit_Name_Must_Be_Unique, 9 | CharacterEdit_Name_Required, 10 | CharacterEdit_Name_Special_Characters, 11 | CharacterEdit_Price_Boundaries, 12 | CharacterEdit_Type_Required 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/ValidationService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HoS_AP.BLL.Models; 3 | using HoS_AP.BLL.ServiceInterfaces; 4 | using HoS_AP.BLL.Validation.Validators; 5 | using HoS_AP.DAL.DaoInterfaces; 6 | 7 | namespace HoS_AP.BLL.Validation 8 | { 9 | internal class ValidationService : IValidationService 10 | { 11 | private readonly AuthenticationValidator authenticationValidator; 12 | private readonly CharacterEditModelValidator characterEditModelValidator; 13 | 14 | public ValidationService(ICharacterDao characterDao, IValidationMessageProvider validationMessageProvider) 15 | { 16 | authenticationValidator = new AuthenticationValidator(validationMessageProvider); 17 | characterEditModelValidator = new CharacterEditModelValidator(characterDao, validationMessageProvider); 18 | } 19 | 20 | ICollection IValidationService.Validate(AuthenticationModel model) 21 | { 22 | return authenticationValidator.Validate(model).Errors.ToValidationResultItem(); 23 | } 24 | 25 | ICollection IValidationService.Validate(CharacterEditModel model) 26 | { 27 | return characterEditModelValidator.Validate(model).Errors.ToValidationResultItem(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/Validation/Validators/AuthenticationModelValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using HoS_AP.BLL.Models; 3 | using HoS_AP.BLL.ServiceInterfaces; 4 | 5 | namespace HoS_AP.BLL.Validation.Validators 6 | { 7 | internal class AuthenticationValidator : AbstractValidator 8 | { 9 | public AuthenticationValidator(IValidationMessageProvider validationMessageProvider) 10 | { 11 | RuleFor(x => x.UserName) 12 | .NotEmpty() 13 | .WithMessage(validationMessageProvider.Get(ValidationMessageKeys.Authentication_UserName_Required)); 14 | RuleFor(x => x.Password) 15 | .NotEmpty() 16 | .WithMessage(validationMessageProvider.Get(ValidationMessageKeys.Authentication_Password_Required)); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.BLL/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Dao/AccountDao.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using HoS_AP.DAL.DaoInterfaces; 3 | using HoS_AP.DAL.Dto; 4 | using HoS_AP.DAL.Repository; 5 | 6 | namespace HoS_AP.DAL.Dao 7 | { 8 | internal class AccountDao : IAccountDao 9 | { 10 | private readonly IGenericRepository repository; 11 | 12 | public AccountDao(IGenericRepository repository) 13 | { 14 | this.repository = repository; 15 | } 16 | 17 | Account IAccountDao.Load(string userName) 18 | { 19 | return repository.Entities.FirstOrDefault(x => x.UserName == userName); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Dao/CharacterDao.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using HoS_AP.DAL.DaoInterfaces; 5 | using HoS_AP.DAL.Dto; 6 | using HoS_AP.DAL.Repository; 7 | using log4net; 8 | 9 | namespace HoS_AP.DAL.Dao 10 | { 11 | internal class CharacterDao : ICharacterDao 12 | { 13 | private static readonly ILog Logger = LogManager.GetLogger("CharacterDao"); 14 | 15 | private readonly IGenericRepository repository; 16 | 17 | public CharacterDao(IGenericRepository repository) 18 | { 19 | Logger.InfoFormat("Creating new instance of CharacterDao with repository of type {0}", repository.GetType()); 20 | this.repository = repository; 21 | } 22 | 23 | ICollection ICharacterDao.Load() 24 | { 25 | return repository.Entities.ToList(); 26 | } 27 | 28 | Character ICharacterDao.Load(string name) 29 | { 30 | return repository.Entities.FirstOrDefault(x => x.Name == name); 31 | } 32 | 33 | void ICharacterDao.Save(Character character) 34 | { 35 | repository.Save(character); 36 | } 37 | 38 | Character ICharacterDao.Load(Guid Id) 39 | { 40 | return repository.Entities.FirstOrDefault(x => x.Id == Id); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/DaoInterfaces/IAccountDao.cs: -------------------------------------------------------------------------------- 1 | using HoS_AP.DAL.Dto; 2 | 3 | namespace HoS_AP.DAL.DaoInterfaces 4 | { 5 | public interface IAccountDao 6 | { 7 | Account Load(string userName); 8 | } 9 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/DaoInterfaces/ICharacterDao.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using HoS_AP.DAL.Dto; 4 | 5 | namespace HoS_AP.DAL.DaoInterfaces 6 | { 7 | public interface ICharacterDao 8 | { 9 | ICollection Load(); 10 | 11 | Character Load(string name); 12 | 13 | void Save(Character character); 14 | 15 | Character Load(Guid Id); 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Dto/Account.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HoS_AP.DAL.Dto 4 | { 5 | [Serializable] 6 | public class Account : BaseDto 7 | { 8 | public string UserName { get; set; } 9 | public string Password { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Dto/BaseDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HoS_AP.DAL.Dto 4 | { 5 | [Serializable] 6 | public abstract class BaseDto 7 | { 8 | public Guid Id { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Dto/Character.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HoS_AP.Misc; 3 | 4 | namespace HoS_AP.DAL.Dto 5 | { 6 | [Serializable] 7 | public class Character : BaseDto 8 | { 9 | public string Name { get; set; } 10 | public CharacterTypes Type { get; set; } 11 | public DateTime Created { get; set; } 12 | public decimal Price { get; set; } 13 | public bool Active { get; set; } 14 | public bool Deleted { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/Repository/IGenericRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using HoS_AP.DAL.Dto; 3 | 4 | namespace HoS_AP.DAL.Repository 5 | { 6 | public interface IGenericRepository where T : BaseDto 7 | { 8 | IQueryable Entities { get; } 9 | 10 | void Save(T entity); 11 | } 12 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DAL/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.DI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Misc/CharacterTypes.cs: -------------------------------------------------------------------------------- 1 | namespace HoS_AP.Misc 2 | { 3 | public enum CharacterTypes 4 | { 5 | None = 0, 6 | Assassin = 1, 7 | Warrior = 2, 8 | Support = 3, 9 | Specialist = 4 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Misc/IInversionOfControlContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace HoS_AP.Misc 5 | { 6 | public interface IInversionOfControlContainer : IDisposable 7 | { 8 | object Resolve(Type serviceType); 9 | 10 | IEnumerable ResolveAll(Type serviceType); 11 | 12 | bool IsRegistered(Type serviceType); 13 | 14 | IInversionOfControlContainer CreateScope(); 15 | } 16 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Misc/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Constants.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace HoS_AP.Web.Tests 4 | { 5 | internal static class Constants 6 | { 7 | internal const int IisPort = 2020; 8 | internal const string WebAppRelativePath = "../../../HoS_AP.Web"; 9 | internal static Process iisProcess; 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/DeleporterHelpers/NinjectControllerFactoryUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace HoS_AP.Web.Tests.DeleporterHelpers 4 | { 5 | //public static class NinjectControllerFactoryUtils 6 | //{ 7 | // public static void TemporarilyReplaceBinding(TService implementation) 8 | // { 9 | // // get a handle on the Ninject Kernel (how you do this will depend on how you setup the Kernel) 10 | // var kernel = DIFactory.Kernel; 11 | // // Remove existing bindings and replace with new one 12 | // var originalBindings = kernel.GetBindings(typeof(TService)).ToList(); 13 | // foreach (var originalBinding in originalBindings) 14 | // kernel.RemoveBinding(originalBinding); 15 | // var replacementBinding = kernel.Bind().ToConstant(implementation).Binding; 16 | 17 | // // Clear up by doing the reverse 18 | // TidyupUtils.AddTidyupTask(() => 19 | // { 20 | // kernel.RemoveBinding(replacementBinding); 21 | // foreach (var originalBinding in originalBindings) 22 | // kernel.AddBinding(originalBinding); 23 | // }); 24 | // } 25 | //} 26 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/DeleporterHelpers/ReadMe.text: -------------------------------------------------------------------------------- 1 | The files in this directory just provide some direction on how you may like to proceed with Deleporter. 2 | Feel free to delete any unused file or to remove the directory entirely. -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/DeleporterHelpers/TidyupUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace HoS_AP.Web.Tests.DeleporterHelpers 6 | { 7 | /// 8 | /// Since you can't usually run multiple integration tests in parallel, this approach to tidying up makes no attempt to 9 | /// manage separate collections of tasks for concurrently running tests. If your test suite does support parallelization 10 | /// to some extent, you might need to enhance this class. 11 | /// 12 | public static class TidyupUtils 13 | { 14 | private static readonly List _tasks = new List(); 15 | 16 | public static void AddTidyupTask(Action task) { _tasks.Add(task); } 17 | 18 | public static void PerformTidyup() 19 | { 20 | try { 21 | foreach (var task in _tasks) 22 | task(); 23 | } 24 | finally { 25 | _tasks.Clear(); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/DeleporterMockStateAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using DeleporterCore.Client; 4 | using HoS_AP.DAL.Dto; 5 | using HoS_AP.DAL.Repository; 6 | using Moq; 7 | 8 | namespace HoS_AP.Web.Tests 9 | { 10 | public class DeleporterMockStateAdapter : IStateAdapter 11 | { 12 | public void InitAccounts(List accounts) 13 | { 14 | Deleporter.Run(() => 15 | { 16 | var repository = new Mock>(); 17 | repository.Setup(x => x.Entities).Returns(accounts.AsQueryable()); 18 | Global.Container.Mock>(repository.Object); 19 | }); 20 | } 21 | 22 | public void InitCharacters(List characters) 23 | { 24 | Deleporter.Run(() => 25 | { 26 | var repository = new Mock>(); 27 | repository.Setup(x => x.Entities).Returns(characters.AsQueryable()); 28 | Global.Container.Mock>(repository.Object); 29 | }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_1.feature: -------------------------------------------------------------------------------- 1 | Feature: Listing 2 | As a Heroes of Storm Administrator 3 | In order to feel control over system state 4 | I want to see existing characters in list 5 | 6 | Scenario: See characters in listing 7 | Given there are the following characters in system 8 | | Name | Price | Type | Active | Deleted | 9 | | Zeratul | 10.00 | Assassin | True | False | 10 | When I am logged in as “Megan” 11 | Then I should be on “Listing” page 12 | And I should see character in list 13 | | Name | Price | Type | Active | Deleted | 14 | | Zeratul | 10.00 | Assassin | True | False | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_2.feature: -------------------------------------------------------------------------------- 1 | Feature: Add new character 2 | As a Heroes of Storm Administrator 3 | In order to deliver new character for gamers 4 | I want to be able to add new character into the system. 5 | Scenario: Beeign able to add new character 6 | Given there are the following characters in system 7 | | Name | Price | Type | Active | Deleted | 8 | And I am logged in as “Megan” 9 | When I navigate to “Add” page 10 | And I fill in controls as follows 11 | | Name | Value | 12 | | Name | Zeratul | 13 | | Price | 10.0 | 14 | | Type | Assassin | 15 | And I click "Add" button 16 | Then I should be on “Listing” page 17 | And I should see character in list 18 | | Name | Price | Type | Active | Deleted | 19 | | Zeratul | 10.00 | Assassin | True | False | 20 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_3.feature: -------------------------------------------------------------------------------- 1 | Feature: Edit existing character 2 | As a Heroes of Storm Administrator 3 | In order to feel control over system state 4 | I want to be able to edit existing character 5 | Scenario: Beeign able to edit existing character 6 | Given there are the following characters in system 7 | | Name | Price | Type | Active | Deleted | 8 | | Zeratul | 10.00 | Assassin | True | False | 9 | And I am logged in as “Megan” 10 | When I navigate to “Edit Zeratul” page 11 | And I fill in controls as follows 12 | | Name | Value | 13 | | Name | Zeratul | 14 | | Price | 12.2 | 15 | | Type | Warrior | 16 | | Active | False | 17 | And I click "Save" button 18 | Then I should be on “Listing” page 19 | And I should see character in list 20 | | Name | Price | Type | Active | Deleted | 21 | | Zeratul | 12.20 | Warrior | False | False | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_4.feature: -------------------------------------------------------------------------------- 1 | Feature: Delete character 2 | As a Heroes of Storm Administrator 3 | In order to feel control over system state 4 | I want to be able to delete character 5 | 6 | Scenario: Being able to delete character 7 | Given there are the following characters in system 8 | | Name | Price | Type | Active | Deleted | 9 | | Zeratul | 10.00 | Assassin | True | False | 10 | When I am logged in as “Megan” 11 | And I navigate to “Edit Zeratul” page 12 | And I click "Delete" button 13 | Then I should be on “Listing” page 14 | And I should see character in list 15 | | Name | Price | Type | Active | Deleted | 16 | | Zeratul | 10.00 | Assassin | True | True | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_5.feature: -------------------------------------------------------------------------------- 1 | Feature: Recover character 2 | As a Heroes of Storm Administrator 3 | In order to feel control over system state 4 | I want to be able to recover character 5 | 6 | Scenario: Being able to recover character 7 | Given there are the following characters in system 8 | | Name | Price | Type | Active | Deleted | 9 | | Zeratul | 10.00 | Assassin | True | True | 10 | When I am logged in as “Megan” 11 | And I navigate to “Edit Zeratul” page 12 | And I click "Recover" button 13 | Then I should be on “Listing” page 14 | And I should see character in list 15 | | Name | Price | Type | Active | Deleted | 16 | | Zeratul | 10.00 | Assassin | True | False | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_6.feature: -------------------------------------------------------------------------------- 1 | Feature: Authentication 2 | As a Heroes of Storm Administrator 3 | In order to feel that character control is in secure 4 | I want to have administration tool secured by username and password 5 | 6 | Scenario: Being able to authenticate 7 | Given Given there is are following users in the system 8 | | Name | Password | 9 | | Megan | 123456 | 10 | When I navigate to “Listing” page 11 | Then I should be on “Login” page 12 | When I fill in controls as follows 13 | | Name | Value | 14 | | UserName | Megan | 15 | | Password | 123456 | 16 | And I click "Sign In" button 17 | Then I should be on “Listing” page -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/Feature_7.feature: -------------------------------------------------------------------------------- 1 | Feature: Feature_7 2 | In order to avoid silly mistakes 3 | As a math idiot 4 | I want to be told the sum of two numbers 5 | 6 | @mytag 7 | Scenario: Being able to authenticate 8 | When I navigate to “Login” page 9 | Then I should not see text "Not Implemented" 10 | When I click "Forgot Password" button 11 | Then I should see text "Not Implemented" -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/IEDriverServer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/IEDriverServer.exe -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/IStateAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HoS_AP.DAL.Dto; 3 | 4 | namespace HoS_AP.Web.Tests 5 | { 6 | internal interface IStateAdapter 7 | { 8 | void InitAccounts(List accounts); 9 | void InitCharacters(List characters); 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/JsonFileStateAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using HoS_AP.DAL.Dto; 4 | using Newtonsoft.Json; 5 | 6 | namespace HoS_AP.Web.Tests 7 | { 8 | public class JsonFileStateAdapter : IStateAdapter 9 | { 10 | public void InitAccounts(List accounts) 11 | { 12 | var path = TestRunConfiguration.GetApplicationPath(); 13 | path = Path.Combine(path, "bin") + "/Accounts.json"; 14 | if (File.Exists(path)) 15 | { 16 | File.Delete(path); 17 | } 18 | 19 | File.WriteAllText(path, JsonConvert.SerializeObject(accounts)); 20 | } 21 | 22 | public void InitCharacters(List characters) 23 | { 24 | var path = TestRunConfiguration.GetApplicationPath(); 25 | path = Path.Combine(path, "bin") + "/Characters.json"; 26 | if (File.Exists(path)) 27 | { 28 | File.Delete(path); 29 | } 30 | 31 | File.WriteAllText(path, JsonConvert.SerializeObject(characters)); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/UrlManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HoS_AP.Web.Tests 4 | { 5 | internal static class UrlManager 6 | { 7 | private static readonly IDictionary knownPages = new Dictionary 8 | { 9 | {"Login", GetAbsoluteUrl("/")}, 10 | {"Listing", GetAbsoluteUrl("/characters")}, 11 | {"Add", GetAbsoluteUrl("/characters/add")} 12 | }; 13 | 14 | internal static string GetPage(string pageName) 15 | { 16 | if (pageName.StartsWith("Edit ")) 17 | { 18 | var entity = pageName.Replace("Edit ", string.Empty); 19 | return GetAbsoluteUrl(string.Format("/characters/{0}/edit", entity)); 20 | } 21 | 22 | return knownPages[pageName]; 23 | } 24 | 25 | private static string GetAbsoluteUrl(string relativeUrl) 26 | { 27 | if (!relativeUrl.StartsWith("/")) 28 | { 29 | relativeUrl = "/" + relativeUrl; 30 | } 31 | return string.Format("http://localhost:{0}{1}", Constants.IisPort, relativeUrl); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/UserManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HoS_AP.Web.Tests 4 | { 5 | internal static class UserManager 6 | { 7 | private static readonly IDictionary knownUsers = new Dictionary 8 | { 9 | {"Megan", "123456"} 10 | }; 11 | 12 | internal static string GetPassword(string username) 13 | { 14 | return knownUsers[username]; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/Content/custom.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="HoS_AP.Web.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/ModelErrorExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using HoS_AP.BLL.Models; 3 | 4 | namespace HoS_AP.Web 5 | { 6 | public static class ModelErrorExtension 7 | { 8 | public static void ToModelErrors(this ValidationResult validationResult, ModelStateDictionary modelState) 9 | { 10 | modelState.Clear(); 11 | foreach (var validationError in validationResult.Errors) 12 | { 13 | modelState.AddModelError(validationError.Property, validationError.Message); 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/MyControllerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Mvc; 3 | using HoS_AP.Misc; 4 | 5 | namespace HoS_AP.Web 6 | { 7 | public class MyControllerFactory : DefaultControllerFactory 8 | { 9 | private readonly IInversionOfControlContainer container; 10 | public MyControllerFactory(IInversionOfControlContainer container) 11 | { 12 | this.container = container; 13 | } 14 | 15 | protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType) 16 | { 17 | if (controllerType != null && container.IsRegistered(controllerType)) 18 | { 19 | return (IController)container.Resolve(controllerType); 20 | } 21 | 22 | return base.GetControllerInstance(requestContext, controllerType); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/Views/Character/Add.cshtml: -------------------------------------------------------------------------------- 1 | @model HoS_AP.BLL.Models.CharacterEditModel 2 | 3 | @{ 4 | ViewBag.Title = "Add Character"; 5 | } 6 | 7 |

Add Character

8 |
9 |
10 |
11 |
12 | @Html.Partial("_CharacterEditControls") 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using (Html.BeginForm("Logout", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) 2 | { 3 | @Html.AntiForgeryToken() 4 | 17 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET MVC/HoS_AP.Web/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.ControllerTests/HomeControllerTests.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | using System.Web.Http; 4 | using Moq; 5 | using NUnit.Framework; 6 | using Web.Api.Controllers; 7 | using Web.Api.Services; 8 | 9 | namespace Web.Api.ControllerTests 10 | { 11 | [TestFixture] 12 | public class HomeControllerTests 13 | { 14 | [Test, TestCase(11), TestCase(22)] 15 | public void Count_should_return_value_from_service(int res) 16 | { 17 | var service = new Mock(); 18 | service.Setup(x => x.CountProducts()).Returns(res); 19 | 20 | var controller = new HomeController(service.Object) 21 | { 22 | Request = new HttpRequestMessage(), 23 | Configuration = new HttpConfiguration() 24 | }; 25 | 26 | var response = controller.Count(); 27 | Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); 28 | Assert.AreEqual(res.ToString(), response.Content.ReadAsStringAsync().Result); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.ControllerTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.ControllerTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.InMemoryTests/IntegrationTests/InMemoryServer.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Threading; 3 | using System.Web.Http; 4 | using Web.Api.Configuration; 5 | using Web.Api.IoC; 6 | 7 | namespace Web.Api.InMemoryTests.IntegrationTests 8 | { 9 | internal sealed class InMemoryServer 10 | { 11 | private readonly HttpMessageInvoker messageInvoker; 12 | 13 | public InMemoryServer() 14 | { 15 | var config = new HttpConfiguration(); 16 | HttpServerConfiguration.Configure(config); 17 | // ReSharper disable once PossibleNullReferenceException 18 | Container = (config.DependencyResolver as MyDependencyResolver).GetContainer() as SimpleIocContainer; 19 | var server = new HttpServer(config); 20 | messageInvoker = new HttpMessageInvoker(new InMemoryHttpContentSerializationHandler(server)); 21 | } 22 | 23 | internal HttpResponseMessage GetResponse(HttpRequestMessage request) 24 | { 25 | return messageInvoker.SendAsync(request, CancellationToken.None).Result; 26 | } 27 | 28 | internal SimpleIocContainer Container { get; } 29 | } 30 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.InMemoryTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.InMemoryTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.JMeterTests/MyWebApi.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using Owin; 3 | using Web.Api.Configuration; 4 | 5 | namespace Web.Api.JMeterTests 6 | { 7 | public class MyWebApi 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | var config = new HttpConfiguration(); 12 | HttpServerConfiguration.Configure(config); 13 | app.UseWebApi(config); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.JMeterTests/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | C:/apache-jmeter-3.0/bin/jmeter.bat 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.JMeterTests/config.csv: -------------------------------------------------------------------------------- 1 | protocol,url,port,path 2 | http,localhost,8888, -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.JMeterTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.OwinTests/MyWebApi.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using Owin; 3 | using Web.Api.Configuration; 4 | using Web.Api.IoC; 5 | 6 | namespace Web.Api.OwinTests 7 | { 8 | public class MyWebApi 9 | { 10 | internal void Configuration(IAppBuilder app) 11 | { 12 | var config = new HttpConfiguration(); 13 | HttpServerConfiguration.Configure(config); 14 | Container = (config.DependencyResolver as MyDependencyResolver).GetContainer() as SimpleIocContainer; 15 | app.UseWebApi(config); 16 | } 17 | 18 | internal SimpleIocContainer Container { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.OwinTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.OwinTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.SelfHostedTests/SelfHostedServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.Http.SelfHost; 3 | using Web.Api.Configuration; 4 | using Web.Api.IoC; 5 | 6 | namespace Web.Api.SelfHostedTests 7 | { 8 | internal sealed class SelfHostedServer : IDisposable 9 | { 10 | internal static readonly string BaseAddress = "http://localhost:8082"; 11 | private readonly HttpSelfHostServer server; 12 | 13 | public SelfHostedServer() 14 | { 15 | var config = new HttpSelfHostConfiguration(BaseAddress); 16 | HttpServerConfiguration.Configure(config); 17 | // ReSharper disable once PossibleNullReferenceException 18 | Container = (config.DependencyResolver as MyDependencyResolver).GetContainer() as SimpleIocContainer; 19 | server = new HttpSelfHostServer(config); 20 | server.OpenAsync().Wait(); 21 | } 22 | 23 | internal SimpleIocContainer Container { get; } 24 | 25 | void IDisposable.Dispose() 26 | { 27 | server.CloseAsync().Wait(); 28 | server.Dispose(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.SelfHostedTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api.SelfHostedTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/ApplicationInsights.config: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Configuration/HttpServerConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using Web.Api.IoC; 3 | 4 | namespace Web.Api.Configuration 5 | { 6 | public static class HttpServerConfiguration 7 | { 8 | public static void Configure(HttpConfiguration config) 9 | { 10 | config.MapHttpAttributeRoutes(); 11 | config.DependencyResolver = new MyDependencyResolver(new SimpleIocContainer()); 12 | config.EnsureInitialized(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Configuration/MyRependencyResolver.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http.Dependencies; 2 | using Web.Api.IoC; 3 | 4 | namespace Web.Api.Configuration 5 | { 6 | public sealed class MyDependencyResolver : MyDependencyScope, IDependencyResolver 7 | { 8 | public MyDependencyResolver(IInversionOfControlContainer container) : base(container) 9 | { 10 | } 11 | 12 | public IDependencyScope BeginScope() 13 | { 14 | return new MyDependencyScope(Container.CreateScope()); 15 | } 16 | 17 | internal IInversionOfControlContainer GetContainer() 18 | { 19 | return Container; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | using System.Web.Http; 4 | using Web.Api.Services; 5 | 6 | namespace Web.Api.Controllers 7 | { 8 | //[Authorize] 9 | public class HomeController : ApiController 10 | { 11 | private readonly IService service; 12 | 13 | public HomeController(IService service) 14 | { 15 | this.service = service; 16 | } 17 | 18 | [Route("Count"), HttpGet] 19 | public HttpResponseMessage Count() 20 | { 21 | return Request.CreateResponse(HttpStatusCode.OK, service.CountProducts()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Web.Api.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Http; 3 | using Web.Api.Configuration; 4 | 5 | namespace Web.Api 6 | { 7 | public class WebApiApplication : HttpApplication 8 | { 9 | protected void Application_Start() 10 | { 11 | HttpServerConfiguration.Configure(GlobalConfiguration.Configuration); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/IoC/IInversionOfControlContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Web.Api.IoC 5 | { 6 | public interface IInversionOfControlContainer : IDisposable 7 | { 8 | object Resolve(Type serviceType); 9 | 10 | IEnumerable ResolveAll(Type serviceType); 11 | 12 | IInversionOfControlContainer CreateScope(); 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Services/IService.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Api.Services 2 | { 3 | public interface IService 4 | { 5 | int CountProducts(); 6 | } 7 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Services/Service.cs: -------------------------------------------------------------------------------- 1 | namespace Web.Api.Services 2 | { 3 | public class Service : IService 4 | { 5 | public int CountProducts() 6 | { 7 | return 999; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Integration testing/ASP.NET Web.API/Web.Api/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp.Tests/PresentationServiceTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Moq; 7 | using NUnit.Framework; 8 | using WebApp.Models; 9 | 10 | namespace WebApp.Tests 11 | { 12 | [TestFixture] 13 | public class PresentationServiceTests 14 | { 15 | [Test] 16 | public void GetTop_should_return_prices_with_taxes() 17 | { 18 | // AAA 19 | // Arrange 20 | var taxesProvider = new Mock(); 21 | var currentCountryProvider = new Mock(); 22 | 23 | currentCountryProvider.Setup(p => p.GetCurrentCountry()).Returns(Countries.US); 24 | taxesProvider.Setup(p => p.GetCurrentTaxValue(Countries.US)).Returns(13m); 25 | 26 | IProductPresentationService service = new ProductPresentationService( 27 | taxesProvider.Object, currentCountryProvider.Object); 28 | 29 | // Act 30 | var products = service.GetTop(1); 31 | 32 | // Assert 33 | Assert.AreEqual(1, products.Count); 34 | Assert.AreEqual(113, products.First().Price); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp.Tests/ProductTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using NUnit.Framework; 4 | using WebApp.Models; 5 | 6 | namespace WebApp.Tests 7 | { 8 | [TestFixture] 9 | public class ProductTests 10 | { 11 | //[Test, TestCaseSource(typeof(ProductTestsSource), "Source")] 12 | //public decimal Price_should_be_calculated_with_taxes(decimal price, Countries country) 13 | //{ 14 | // var product = new Product("Name", price, country); 15 | // return product.Price; 16 | //} 17 | } 18 | 19 | public class ProductTestsSource 20 | { 21 | public static IEnumerable Source 22 | { 23 | get 24 | { 25 | yield return new TestCaseData(100m, Countries.BY).Returns(112m); 26 | yield return new TestCaseData(100m, Countries.RU).Returns(113m); 27 | yield return new TestCaseData(100m, Countries.CA).Returns(115m); 28 | yield return new TestCaseData(100m, Countries.US).Returns(120m); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace WebApp 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using WebApp.Models; 7 | 8 | namespace WebApp.Controllers 9 | { 10 | public class HomeController : Controller 11 | { 12 | private IProductPresentationService productPresentationService 13 | = new ProductPresentationService(null, null); 14 | // GET: Home 15 | public ActionResult Index() 16 | { 17 | var model = productPresentationService.GetTop(1).FirstOrDefault(); 18 | return View(model); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="WebApp.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace WebApp 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/ICurrentCountryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using WebApp.Models; 3 | 4 | namespace WebApp 5 | { 6 | public interface ICurrentCountryProvider 7 | { 8 | Countries GetCurrentCountry(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/IProductPresentationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using WebApp.Models; 7 | 8 | namespace WebApp 9 | { 10 | public interface IProductPresentationService 11 | { 12 | ICollection GetTop(int top); 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/ITaxesProvider.cs: -------------------------------------------------------------------------------- 1 | using WebApp.Models; 2 | 3 | namespace WebApp 4 | { 5 | public interface ITaxesProvider 6 | { 7 | decimal GetCurrentTaxValue(Countries country); 8 | } 9 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Models/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace WebApp.Models 7 | { 8 | public enum Countries 9 | { 10 | BY, RU, US, CA 11 | } 12 | 13 | //public class Taxes : Dictionary 14 | //{ 15 | // private static Taxes instance; 16 | 17 | // static Taxes() 18 | // { 19 | // instance = new Taxes(); 20 | // } 21 | 22 | // private Taxes() 23 | // { 24 | // this.Add(Countries.BY, 12); 25 | // this.Add(Countries.RU, 13); 26 | // this.Add(Countries.CA, 15); 27 | // this.Add(Countries.US, 20); 28 | // } 29 | 30 | // public static Taxes Instance => instance; 31 | //} 32 | 33 | public class Product 34 | { 35 | public Product(string name, decimal price) 36 | { 37 | Name = name; 38 | Price = price; 39 | } 40 | 41 | public string Name { get; } 42 | 43 | public decimal Price { get; } 44 | } 45 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/ProductPresentationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using WebApp.Models; 6 | 7 | namespace WebApp 8 | { 9 | public class ProductPresentationService : IProductPresentationService 10 | { 11 | private readonly ITaxesProvider taxesProvider; 12 | private readonly ICurrentCountryProvider currentCountryProvider; 13 | 14 | public ProductPresentationService(ITaxesProvider taxesProvider, ICurrentCountryProvider currentCountryProvider) 15 | { 16 | this.taxesProvider = taxesProvider; 17 | this.currentCountryProvider = currentCountryProvider; 18 | } 19 | 20 | public ICollection GetTop(int top) 21 | { 22 | var result = new List(); 23 | 24 | var price = 100; 25 | var country = currentCountryProvider.GetCurrentCountry(); 26 | 27 | while (top > 0) 28 | { 29 | result.Add(new Product("Name", CalculateWithTax(price, country))); 30 | top--; 31 | } 32 | 33 | return result; 34 | } 35 | 36 | private decimal CalculateWithTax(decimal price, Countries country) 37 | { 38 | return price + price*(taxesProvider.GetCurrentTaxValue(country)/100); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Service References/Application Insights/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider", 3 | "Version": "7.18.214.2", 4 | "GettingStartedDocument": { 5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=613413" 6 | } 7 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model WebApp.Models.Product 2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Index

7 | 8 |

@Model.Name

9 |

@Model.Price

10 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 19 - Testing/Unit testing/WebApp/WebApp/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 19 - Testing/Unit testing/WebApp/WebApp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lesson 3 - CSS/Linked CSS/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
12
34
20 | 21 |

Lorem ipsum

22 | 23 | 24 | -------------------------------------------------------------------------------- /Lesson 3 - CSS/Linked CSS/index1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

text

7 | 8 | -------------------------------------------------------------------------------- /Lesson 3 - CSS/Linked CSS/stylesheet.css: -------------------------------------------------------------------------------- 1 | TABLE { 2 | border: 1px solid black; 3 | } 4 | 5 | TD { 6 | border: 1px solid black; 7 | padding: 5px; 8 | font-size: 24px; 9 | } 10 | 11 | TD.r1c1 { 12 | font-family: Arial; 13 | } 14 | 15 | .f45 { 16 | font-size: 45px; 17 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/Lesson 6.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleWebApp", "SimpleWebApp\SimpleWebApp.csproj", "{9FBC1174-2E28-43CA-9BC7-D3301F797D6A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9FBC1174-2E28-43CA-9BC7-D3301F797D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9FBC1174-2E28-43CA-9BC7-D3301F797D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9FBC1174-2E28-43CA-9BC7-D3301F797D6A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9FBC1174-2E28-43CA-9BC7-D3301F797D6A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SimpleWebApp 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using SimpleWebApp.Models; 3 | 4 | namespace SimpleWebApp.Controllers 5 | { 6 | public class HomeController : Controller 7 | { 8 | public ActionResult Index() 9 | { 10 | var provider = new CategoryProvider(); 11 | return View(provider.Categorues()); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SimpleWebApp.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SimpleWebApp 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Models/Category.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace SimpleWebApp.Models 4 | { 5 | public class Category 6 | { 7 | public string Name; 8 | public Collection Products; 9 | public Collection SubCategories; 10 | } 11 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Models/CategoryProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace SimpleWebApp.Models 4 | { 5 | public class CategoryProvider 6 | { 7 | public Collection Categorues() 8 | { 9 | var result = new Collection(); 10 | var c1 = new Category(); 11 | c1.Name = "Pants"; 12 | c1.Products = new Collection(); 13 | 14 | var c1p1 = new Product(); 15 | c1p1.Name = "Yellow pants"; 16 | c1p1.Price = 12; 17 | 18 | var c1p2 = new Product(); 19 | c1p2.Name = "Blue pants"; 20 | c1p2.Price = 13; 21 | 22 | c1.Products.Add(c1p1); 23 | c1.Products.Add(c1p2); 24 | 25 | var c2 = new Category(); 26 | c2.Name = "T-shirts"; 27 | c2.Products = new Collection(); 28 | 29 | var c2p1 = new Product(); 30 | c2p1.Name = "White t-shirt"; 31 | c2p1.Price = 12; 32 | 33 | var c2p2 = new Product(); 34 | c2p2.Name = "Black t-shirt"; 35 | c2p2.Price = 13; 36 | 37 | c2.Products.Add(c2p1); 38 | c2.Products.Add(c2p2); 39 | 40 | result.Add(c1); 41 | result.Add(c2); 42 | 43 | return result; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Models/Dress.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleWebApp.Models 2 | { 3 | public class Dress 4 | { 5 | public string Name; 6 | public decimal Price; 7 | } 8 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleWebApp.Models 2 | { 3 | public class Product 4 | { 5 | public string Name; 6 | public decimal Price; 7 | } 8 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Collections.ObjectModel.Collection 2 | 3 | @{ 4 | ViewBag.Title = "title"; 5 | } 6 | 7 | @if (Model != null) 8 | { 9 | foreach (var category in Model) 10 | { 11 | @Html.Partial("Category", category) 12 | } 13 | } 14 | else 15 | { 16 |
There are no categories.
17 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Views/Shared/Category.cshtml: -------------------------------------------------------------------------------- 1 | @model SimpleWebApp.Models.Category 2 | 3 |
4 | @Model.Name 5 | 6 | @if (Model.SubCategories != null) 7 | { 8 | foreach (var subCategory in Model.SubCategories) 9 | { 10 | @Html.Partial("Category", subCategory) 11 | } 12 | } 13 | 14 | @if (Model.Products != null) 15 | { 16 |
    17 | @foreach (var product in Model.Products) 18 | { 19 |
  • @product.Price $, @product.Name
  • 20 | } 21 |
22 | } 23 |
-------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | 8 | 9 | 25 | 26 |
27 | @RenderBody() 28 |
29 |
30 |

© @DateTime.Now.Year - My ASP.NET Application

31 |
32 |
33 | 34 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 6 - IDE and Tools/SimpleWebApp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Homework.md: -------------------------------------------------------------------------------- 1 | Lesson 7 Homework 2 | ================== 3 | Создать 2 страницы 4 | 1. О компании 5 | 2. Курсы валют 6 | 7 | Обе страницы должны иметь в шапке кросс-ссылку (ссылку на соседнюю страницу). 8 | 9 | Для этого: 10 | 1. Создать 2 действия в контроллере. 11 | 2. Создать 2 модели (по одной на каждый контейнер данных для страницы). 12 | 3. Предать модели на представления. 13 | 4. Создать 2 представления. 14 | 5. Разобрать контейнер данных на представлениях и сгенерировать HTML. 15 | 6. Вставить секцию в мастер страницу и наполнить эту секцию кросс-ссылкой. 16 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeetMvcFramework", "MeetMvcFramework\MeetMvcFramework.csproj", "{58B90102-4609-4505-8427-3F432F1E17FE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {58B90102-4609-4505-8427-3F432F1E17FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {58B90102-4609-4505-8427-3F432F1E17FE}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {58B90102-4609-4505-8427-3F432F1E17FE}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {58B90102-4609-4505-8427-3F432F1E17FE}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MeetMvcFramework 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using MeetMvcFramework.Models; 7 | 8 | namespace MeetMvcFramework.Controllers 9 | { 10 | public class HomeController : Controller 11 | { 12 | // GET: Home 13 | public ActionResult Index() 14 | { 15 | var cat = new Cat(); 16 | cat.Name = "Tom"; 17 | cat.Age = 2; 18 | 19 | //var dog = new Dog(); 20 | //dog.Name = "Chappie"; 21 | //dog.Owner = "Alex"; 22 | 23 | return View(cat); 24 | } 25 | 26 | public ActionResult Dog() 27 | { 28 | var dog = new Dog(); 29 | dog.Name = "Chappie"; 30 | dog.Owner = "Alex"; 31 | 32 | return View(dog); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MeetMvcFramework.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MeetMvcFramework 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Models/Cat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace MeetMvcFramework.Models 7 | { 8 | public class Cat 9 | { 10 | public string Name; 11 | public int Age; 12 | } 13 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Models/Dog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace MeetMvcFramework.Models 7 | { 8 | public class Dog 9 | { 10 | public string Name; 11 | public string Owner; 12 | } 13 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Views/Home/Dog.cshtml: -------------------------------------------------------------------------------- 1 | @model MeetMvcFramework.Models.Dog 2 | 3 | @{ 4 | Layout = "~/Views/Shared/_Green.cshtml"; 5 | } 6 | 7 | @section NestedMenu 8 | { 9 | Hey! 10 | } 11 | 12 |

Dog's name: @Model.Name

13 |

Owner: @Model.Owner

14 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model MeetMvcFramework.Models.Cat 2 | 3 | 4 | @section Menu 5 | { 6 | Hey! 7 | } 8 | 9 |

@Model.Name

10 |

@Model.Age

-------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Views/Shared/_Green.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | Layout = "~/Views/Shared/_Layout.cshtml"; 4 | } 5 | 6 | @section Menu 7 | { 8 | @RenderSection("NestedMenu", false) 9 | } 10 | 11 |
12 | @RenderBody() 13 |
14 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/MeetMvcFramework/MeetMvcFramework/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blog", "Blog\Blog.csproj", "{CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Blog 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using Blog.Models; 7 | 8 | namespace Blog.Controllers 9 | { 10 | public class HomeController : Controller 11 | { 12 | // GET: Home 13 | public ActionResult Index() 14 | { 15 | PageModel model = new PageModel("Alex", 32); 16 | PageModel model2 = new PageModel 17 | { 18 | Name2 = "Lisa", 19 | Age2 = 28 20 | }; 21 | 22 | return View(model); 23 | } 24 | 25 | public ActionResult Index2() 26 | { 27 | return View(); 28 | } 29 | 30 | public ActionResult Contact() 31 | { 32 | PageModel model = new PageModel("Alisa", 4); 33 | return View("Contact", model); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Blog.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Blog 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Models/PageModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Blog.Models 7 | { 8 | public class PageModel 9 | { 10 | private readonly string name; 11 | private readonly int age; 12 | 13 | internal PageModel() 14 | { 15 | } 16 | 17 | internal PageModel(string name, int age) 18 | { 19 | this.name = name; 20 | this.age = age; 21 | } 22 | 23 | public string Name 24 | { 25 | get { return this.name; } 26 | } 27 | 28 | public int GetAge() 29 | { 30 | return this.age; 31 | } 32 | 33 | 34 | public string Name2 { get; set; } 35 | 36 | public int Age2 { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Blog.Models.PageModel 2 | 3 |
4 | Hello from page template 5 | 6 |

@Model.Name

7 | @Model.GetAge() 8 | 9 | @Html.Partial("Contact", Model) 10 |
11 | 12 | @section footer{ 13 |
14 | Hello from page template section "footer" 15 | @Html.Partial("Contact") 16 |
17 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/Home/Index2.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout2.cshtml"; 3 | } 4 | 5 |
6 | Hello from page template 7 | @Html.Partial("Contact") 8 |
9 | 10 | @section footer{ 11 |
12 | Hello from page template section "footer" 13 | @Html.Partial("Contact") 14 |
15 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/Shared/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @model Blog.Models.PageModel 2 | @{ 3 | Layout = null; 4 | } 5 | 6 |
7 |

@Model.Name

8 |

@Model.GetAge()

9 |
-------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 |
4 |

Hello from parent template

5 | @RenderBody() 6 |

Hello from parent template

7 | @RenderSection("footer", false) 8 | @*@Html.Partial("Contact")*@ 9 | @Html.Action("Contact") 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/Shared/_Layout2.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 |
5 |

Hello from parent template

6 | @RenderBody() 7 |

Hello from parent template

8 | @Html.Partial("Contact") 9 |
10 | 11 | @section footer{ 12 | @RenderSection("footer", false) 13 | } 14 | -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 8 - ASP.NET MVC Framework/Views (2017.01.05)/Blog/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blog", "Blog\Blog.csproj", "{CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CD9A3892-E5ED-4554-A1C2-FB8AFDCF0215}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Blog 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Listing", 18 | url: "articles/{pageNumber}/{pageSize}", 19 | defaults: new { controller = "Article", action = "Listing", pageNumber = 1, pageSize = 50 }); 20 | 21 | routes.MapRoute("Article", "{articleName}", new { controller = "Article", action = "View" }); 22 | 23 | routes.MapRoute( 24 | name: "Default", 25 | url: "{controller}/{action}/{id}", 26 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 27 | ); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Controllers/ArticleController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace Blog.Controllers 8 | { 9 | [RoutePrefix("articles")] 10 | public class ArticleController : Controller 11 | { 12 | [Route("{pageNumber}/{pageSize}")] 13 | public ActionResult Listing(int pageNumber, int pageSize) 14 | { 15 | return new EmptyResult(); 16 | } 17 | 18 | [Route("{articleName}")] 19 | public ActionResult View(string articleName) 20 | { 21 | return new EmptyResult(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using Blog.Models; 7 | 8 | namespace Blog.Controllers 9 | { 10 | [Route] 11 | public class HomeController : Controller 12 | { 13 | // GET: Home 14 | public ActionResult Index() 15 | { 16 | PageModel model = new PageModel("Alex", 32); 17 | PageModel model2 = new PageModel 18 | { 19 | Name2 = "Lisa", 20 | Age2 = 28 21 | }; 22 | 23 | return View(model); 24 | } 25 | 26 | public ActionResult Index2() 27 | { 28 | PageModel model = new PageModel("Alex", 32); 29 | return View(model); 30 | } 31 | 32 | public ActionResult Contact() 33 | { 34 | PageModel model = new PageModel("Alisa", 4); 35 | return View("Contact", model); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Blog.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Blog 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteTable.Routes.MapMvcAttributeRoutes(); 16 | //RouteConfig.RegisterRoutes(RouteTable.Routes); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Models/PageModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Blog.Models 7 | { 8 | public class PageModel 9 | { 10 | private readonly string name; 11 | private readonly int age; 12 | 13 | internal PageModel() 14 | { 15 | } 16 | 17 | internal PageModel(string name, int age) 18 | { 19 | this.name = name; 20 | this.age = age; 21 | } 22 | 23 | public string Name 24 | { 25 | get { return this.name; } 26 | } 27 | 28 | public int GetAge() 29 | { 30 | return this.age; 31 | } 32 | 33 | 34 | public string Name2 { get; set; } 35 | 36 | public int Age2 { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Blog.Models.PageModel 2 | 3 |
4 | Hello from page template 5 | 6 |

@Model.Name

7 | @Model.GetAge() 8 | 9 | @Html.ActionLink("List", "Listing", "Article", new {pageNumber = 5, pageSize = Model.GetAge()}, null ) 10 | 11 | @Url.Action("Listing", "Article", new { pageNumber = 5, pageSize = Model.GetAge()}) 12 | @Url.RouteUrl("Listing", new { pageNumber = 5, pageSize = Model.GetAge() }) 13 | 14 | @Html.Partial("Contact", Model) 15 |
16 | 17 | @section footer{ 18 |
19 | Hello from page template section "footer" 20 | @Html.Partial("Contact") 21 |
22 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/Home/Index2.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout2.cshtml"; 3 | } 4 | 5 |
6 | Hello from page template 7 | @Html.Partial("Contact") 8 |
9 | 10 | @section footer{ 11 |
12 | Hello from page template section "footer" 13 | @Html.Partial("Contact") 14 |
15 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/Shared/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @model Blog.Models.PageModel 2 | @{ 3 | Layout = null; 4 | } 5 | 6 |
7 |

@Model.Name

8 |

@Model.GetAge()

9 |
-------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 |
4 |

Hello from parent template

5 | @RenderBody() 6 |

Hello from parent template

7 | @RenderSection("footer", false) 8 | @*@Html.Partial("Contact")*@ 9 | @Html.Action("Contact") 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/Shared/_Layout2.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 |
5 |

Hello from parent template

6 | @RenderBody() 7 |

Hello from parent template

8 | @Html.Partial("Contact") 9 |
10 | 11 | @section footer{ 12 | @RenderSection("footer", false) 13 | } 14 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/Blog (2017.01.26)/Blog/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcApplication", "MvcApplication\MvcApplication.csproj", "{7642CE24-26A5-4BFC-AD9F-3ED39359ADD5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7642CE24-26A5-4BFC-AD9F-3ED39359ADD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7642CE24-26A5-4BFC-AD9F-3ED39359ADD5}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7642CE24-26A5-4BFC-AD9F-3ED39359ADD5}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7642CE24-26A5-4BFC-AD9F-3ED39359ADD5}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace MvcApplication 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.MapMvcAttributeRoutes(); 11 | //routes.MapRoute("product-special", "pro/{productName}", 12 | // new { controller = "Product", action = "Details", productName = UrlParameter.Optional }); 13 | //// Это маршрут по умолчанию 14 | //routes.MapRoute( 15 | // name: "Default", 16 | // url: "{controller}/{action}/{id}", 17 | // defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 18 | //); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace MvcApplication.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | [Route("")] 8 | public ActionResult Index() 9 | { 10 | return View(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Controllers/ProductController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace MvcApplication.Controllers 8 | { 9 | [RoutePrefix("pro")] 10 | public class ProductController : Controller 11 | { 12 | 13 | public ActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | [Route("duct/{productName}/details")] 19 | public ActionResult Details(string productName = "tv1") 20 | { 21 | return View(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MvcApplication.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | using System.Web.Routing; 4 | 5 | namespace MvcApplication 6 | { 7 | public class MvcApplication : HttpApplication 8 | { 9 | protected void Application_Start() 10 | { 11 | AreaRegistration.RegisterAllAreas(); 12 | RouteConfig.RegisterRoutes(RouteTable.Routes); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 |
4 | Hello from page 5 | 6 | Apple 7 |
8 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Views/Product/Details.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Details"; 4 | } 5 | 6 |

Details

7 | 8 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Views/Product/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Index"; 4 | } 5 | 6 |

Index

7 | 8 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | Error 10 | 11 | 12 |
13 |

Error.

14 |

An error occurred while processing your request.

15 |
16 | 17 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/Lesson 9 - Routes/MvcApplication/MvcApplication/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Lesson 9 - Routes/MvcApplication/MvcApplication/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MovieProject/MovieProject.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MovieProject", "MovieProject\MovieProject.csproj", "{FCD30CF6-A2BF-4726-9FC7-9D6802754FE0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FCD30CF6-A2BF-4726-9FC7-9D6802754FE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FCD30CF6-A2BF-4726-9FC7-9D6802754FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FCD30CF6-A2BF-4726-9FC7-9D6802754FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FCD30CF6-A2BF-4726-9FC7-9D6802754FE0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MovieProject/MovieProject/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MovieProject 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MovieProject/MovieProject/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | using MovieProject.Models; 8 | 9 | namespace MovieProject.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | // GET: Home 14 | public ActionResult Index() 15 | { 16 | var model = new IndexModel(); 17 | model.Top1Movie = new Top1MovieModel(); 18 | model.Top1Movie.Name = "Terminator 2"; 19 | model.Top1Movie.Directors = new Collection(); 20 | model.Top1Movie.Directors.Add("Dave"); 21 | model.Top1Movie.ImageUri = "/images/header-bg.jpg"; 22 | model.Top1Movie.Rating = 5.5f; 23 | model.Top1Movie.ReleaDate = new DateTime(2011, 4, 5); 24 | 25 | return View(model); 26 | } 27 | 28 | public ActionResult Error404() 29 | { 30 | return View(); 31 | } 32 | 33 | public ActionResult Reviews() 34 | { 35 | return View(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /MovieProject/MovieProject/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MovieProject.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /MovieProject/MovieProject/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace MovieProject 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MovieProject/MovieProject/Models/IndexModel.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Web; 3 | 4 | namespace MovieProject.Models 5 | { 6 | public class IndexModel 7 | { 8 | public Top1MovieModel Top1Movie { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /MovieProject/MovieProject/Models/Mpaa.cs: -------------------------------------------------------------------------------- 1 | namespace MovieProject.Models 2 | { 3 | public enum Mpaa 4 | { 5 | G, PG, PG13, R, NC17 6 | } 7 | } -------------------------------------------------------------------------------- /MovieProject/MovieProject/Models/Top1MovieModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace MovieProject.Models 5 | { 6 | public class Top1MovieModel 7 | { 8 | public string ImageUri { get; set; } 9 | public string Name { get; set; } 10 | public Mpaa MPAA { get; set; } 11 | public ICollection Directors { get; set; } 12 | public float Rating { get; set; } 13 | public ICollection Genres { get; set; } 14 | public DateTime ReleaDate { get; set; } 15 | public string Slogan { get; set; } 16 | 17 | public string GenresString 18 | { 19 | get { return Concat(Genres); } 20 | } 21 | 22 | public string DirectorsString 23 | { 24 | get { return Concat(Directors); } 25 | } 26 | 27 | private string Concat(ICollection items) 28 | { 29 | return items == null 30 | ? string.Empty 31 | : string.Join(", ", items); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /MovieProject/MovieProject/Views/Home/Error404.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Error404"; 3 | } 4 | 5 |
6 |
7 | @Html.Partial("Header") 8 |
9 |

404

10 |

Sorry this was unexpected

11 | Back to Home 12 |
13 | @Html.Partial("Footer") 14 |
15 |
16 |
-------------------------------------------------------------------------------- /MovieProject/MovieProject/Views/Shared/Footer.cshtml: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /MovieProject/MovieProject/Views/Shared/Header.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | 8 | 14 |
15 |
-------------------------------------------------------------------------------- /MovieProject/MovieProject/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /MovieProject/MovieProject/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /MovieProject/MovieProject/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MovieProject/MovieProject/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MovieProject/MovieProject/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/beauty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/beauty.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/dot.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/eye-brow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/eye-brow.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f1.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f2.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f3.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f4.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f5.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/f6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/f6.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum1.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum10.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum11.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum2.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum3.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum4.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum5.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum6.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum7.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum8.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/gridallbum9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/gridallbum9.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/header-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/header-bg.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/img-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/img-sprite.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/likes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/likes.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/link.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/logo.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/m1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/m1.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/m2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/m2.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/m3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/m3.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/m4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/m4.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/mi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/mi.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/mi1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/mi1.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/mi2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/mi2.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/mi3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/mi3.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r1.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r2.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r3.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r4.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r5.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/r6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/r6.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/sprit-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/sprit-1.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/stylish.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/stylish.jpg -------------------------------------------------------------------------------- /MovieProject/MovieProject/images/views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lAnubisl/WebApplicationsDevelopmentLessons/384733ac58c4b51e16e0ce46b96e0c1d5d9d4a08/MovieProject/MovieProject/images/views.png -------------------------------------------------------------------------------- /MovieProject/MovieProject/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Разработка веб-приложений 2 | 3 | [![Join the chat at https://gitter.im/lAnubisl/WebApplicationsDevelopmentLessons](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lAnubisl/WebApplicationsDevelopmentLessons?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | Курс по разработке веб-приложений с использованием стека технологий C#, Microsoft ASP.NET MVC, Microsoft SQL Server. 5 | 6 | * [План курса](https://github.com/lAnubisl/WebApplicationsDevelopmentLessons/blob/master/LessonsPlan.md) 7 | * [Исходные коды](https://github.com/lAnubisl/WebApplicationsDevelopmentLessons) 8 | * [Записи лекций](https://www.youtube.com/channel/UCQu1ll4WgyxuxMVsdMl0AMw) 9 | * [Задание для курсового проекта](https://github.com/lAnubisl/WebApplicationsDevelopmentLessons/blob/master/CourseWork.md) --------------------------------------------------------------------------------