()
19 | .Build();
20 |
21 | host.Run();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/IEmailSender.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services
7 | {
8 | public interface IEmailSender
9 | {
10 | Task SendEmailAsync(string email, string subject, string message);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/ISmsSender.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services
7 | {
8 | public interface ISmsSender
9 | {
10 | Task SendSmsAsync(string number, string message);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Services/MessageServices.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace Glimpse.AgentServer.AspNet.Mvc.Sample.Services
7 | {
8 | // This class is used by the application to send Email and SMS
9 | // when you turn on two-factor authentication in ASP.NET Identity.
10 | // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713
11 | public class AuthMessageSender : IEmailSender, ISmsSender
12 | {
13 | public Task SendEmailAsync(string email, string subject, string message)
14 | {
15 | // Plug in your email service here to send an email.
16 | return Task.FromResult(0);
17 | }
18 |
19 | public Task SendSmsAsync(string number, string message)
20 | {
21 | // Plug in your SMS service here to send a text message.
22 | return Task.FromResult(0);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Confirm Email";
3 | }
4 |
5 | @ViewData["Title"].
6 |
11 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ExternalLoginFailure.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Login Failure";
3 | }
4 |
5 |
9 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ForgotPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model ForgotPasswordViewModel
2 | @{
3 | ViewData["Title"] = "Forgot your password?";
4 | }
5 |
6 | @ViewData["Title"]
7 |
8 | For more information on how to enable reset password please see this article.
9 |
10 |
11 | @**@
28 |
29 | @section Scripts {
30 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
31 | }
32 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ForgotPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Forgot Password Confirmation";
3 | }
4 |
5 | @ViewData["Title"].
6 |
7 | Please check your email to reset your password.
8 |
9 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/Lockout.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Locked out";
3 | }
4 |
5 |
9 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/ResetPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Reset password confirmation";
3 | }
4 |
5 | @ViewData["Title"].
6 |
7 | Your password has been reset. Please Click here to log in.
8 |
9 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Account/SendCode.cshtml:
--------------------------------------------------------------------------------
1 | @model SendCodeViewModel
2 | @{
3 | ViewData["Title"] = "Send Verification Code";
4 | }
5 |
6 | @ViewData["Title"].
7 |
8 |
18 |
19 | @section Scripts {
20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 | Use this area to provide additional information.
8 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Home/Contact.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Contact";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P:
11 | 425.555.0100
12 |
13 |
14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com
17 |
18 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Manage/AddPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model AddPhoneNumberViewModel
2 | @{
3 | ViewData["Title"] = "Add Phone Number";
4 | }
5 |
6 | @ViewData["Title"].
7 |
24 |
25 | @section Scripts {
26 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
27 | }
28 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Manage/VerifyPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model VerifyPhoneNumberViewModel
2 | @{
3 | ViewData["Title"] = "Verify Phone Number";
4 | }
5 |
6 | @ViewData["Title"].
7 |
8 |
27 |
28 | @section Scripts {
29 | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
30 | }
31 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Error";
3 | }
4 |
5 | Error.
6 | An error occurred while processing your request.
7 |
8 | Development Mode
9 |
10 | Swapping to Development environment will display more detailed information about the error that occurred.
11 |
12 |
13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/_LoginPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Identity
2 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models
3 |
4 | @inject SignInManager SignInManager
5 | @inject UserManager UserManager
6 |
7 | @if (SignInManager.IsSignedIn(User))
8 | {
9 |
19 | }
20 | else
21 | {
22 |
26 | }
27 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using Glimpse.AgentServer.AspNet.Mvc.Sample
2 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models
3 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models.AccountViewModels
4 | @using Glimpse.AgentServer.AspNet.Mvc.Sample.Models.ManageViewModels
5 | @using Microsoft.AspNetCore.Identity
6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
7 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ConnectionStrings": {
3 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Glimpse.AgentServer.AspNet.Mvc.Sample-dbd166cf-e778-4976-a0f5-6c3de1011986;Trusted_Connection=True;MultipleActiveResultSets=true"
4 | },
5 | "Logging": {
6 | "IncludeScopes": false,
7 | "LogLevel": {
8 | "Default": "Debug",
9 | "System": "Information",
10 | "Microsoft": "Information"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asp.net",
3 | "private": true,
4 | "dependencies": {
5 | "bootstrap": "3.3.6",
6 | "jquery": "2.2.0",
7 | "jquery-validation": "1.14.0",
8 | "jquery-validation-unobtrusive": "3.2.6"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | "minify": {
18 | "enabled": true,
19 | "renameLocals": true
20 | },
21 | // Optinally generate .map file
22 | "sourceMap": false
23 | }
24 | ]
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/_references.js:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 | ///
5 | ///
6 | ///
7 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your Javascript code.
2 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 2"
33 | },
34 | "version": "3.3.6",
35 | "_release": "3.3.6",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.6",
39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a"
40 | },
41 | "_source": "git://github.com/twbs/bootstrap.git",
42 | "_target": "3.3.6",
43 | "_originalSource": "bootstrap"
44 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2015 Twitter, Inc
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
13 | all 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
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "http://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jzaefferer/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.14.0",
31 | "_release": "1.14.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.14.0",
35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48"
36 | },
37 | "_source": "git://github.com/jzaefferer/jquery-validation.git",
38 | "_target": ">=1.8",
39 | "_originalSource": "jquery-validation"
40 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Sample/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "2.2.0",
16 | "_release": "2.2.0",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "2.2.0",
20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5"
21 | },
22 | "_source": "git://github.com/jquery/jquery-dist.git",
23 | "_target": "2.2.0",
24 | "_originalSource": "jquery"
25 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "wwwroot/lib"
3 | }
4 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Mvc;
6 |
7 | namespace Glimpse.AgentServer.AspNet.Mvc.Simple.Sample.Controllers
8 | {
9 | public class HomeController : Controller
10 | {
11 | public IActionResult Index()
12 | {
13 | return View();
14 | }
15 |
16 | public IActionResult About()
17 | {
18 | ViewData["Message"] = "Your application description page.";
19 |
20 | return View();
21 | }
22 |
23 | public IActionResult Contact()
24 | {
25 | ViewData["Message"] = "Your contact page.";
26 |
27 | return View();
28 | }
29 |
30 | public IActionResult Error()
31 | {
32 | return View();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Hosting;
7 |
8 | namespace Glimpse.AgentServer.AspNet.Mvc.Simple.Sample
9 | {
10 | public class Program
11 | {
12 | public static void Main(string[] args)
13 | {
14 | var host = new WebHostBuilder()
15 | .UseKestrel()
16 | .UseContentRoot(Directory.GetCurrentDirectory())
17 | .UseIISIntegration()
18 | .UseStartup()
19 | .Build();
20 |
21 | host.Run();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 | Use this area to provide additional information.
8 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Home/Contact.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Contact";
3 | }
4 | @ViewData["Title"].
5 | @ViewData["Message"]
6 |
7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P:
11 | 425.555.0100
12 |
13 |
14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com
17 |
18 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Error";
3 | }
4 |
5 | Error.
6 | An error occurred while processing your request.
7 |
8 | Development Mode
9 |
10 | Swapping to Development environment will display more detailed information about the error that occurred.
11 |
12 |
13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using Glimpse.AgentServer.AspNet.Mvc.Simple.Sample
2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "asp.net",
3 | "private": true,
4 | "dependencies": {
5 | "bootstrap": "3.3.6",
6 | "jquery": "2.2.0",
7 | "jquery-validation": "1.14.0",
8 | "jquery-validation-unobtrusive": "3.2.6"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | "minify": {
18 | "enabled": true,
19 | "renameLocals": true
20 | },
21 | // Optinally generate .map file
22 | "sourceMap": false
23 | }
24 | ]
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/_references.js:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 | ///
5 | ///
6 | ///
7 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Wrapping element */
7 | /* Set some basic padding to keep content from hitting the edges */
8 | .body-content {
9 | padding-left: 15px;
10 | padding-right: 15px;
11 | }
12 |
13 | /* Set widths on the form inputs since otherwise they're 100% wide */
14 | input,
15 | select,
16 | textarea {
17 | max-width: 280px;
18 | }
19 |
20 | /* Carousel */
21 | .carousel-caption p {
22 | font-size: 20px;
23 | line-height: 1.4;
24 | }
25 |
26 | /* Make .svg files in the carousel display properly in older browsers */
27 | .carousel-inner .item img[src$=".svg"]
28 | {
29 | width: 100%;
30 | }
31 |
32 | /* Hide/rearrange for smaller screens */
33 | @media screen and (max-width: 767px) {
34 | /* Hide captions */
35 | .carousel-caption {
36 | display: none
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your Javascript code.
2 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 2"
33 | },
34 | "version": "3.3.6",
35 | "_release": "3.3.6",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.6",
39 | "commit": "81df608a40bf0629a1dc08e584849bb1e43e0b7a"
40 | },
41 | "_source": "git://github.com/twbs/bootstrap.git",
42 | "_target": "3.3.6",
43 | "_originalSource": "bootstrap"
44 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2015 Twitter, Inc
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
13 | all 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
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "http://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jzaefferer/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.14.0",
31 | "_release": "1.14.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.14.0",
35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48"
36 | },
37 | "_source": "git://github.com/jzaefferer/jquery-validation.git",
38 | "_target": ">=1.8",
39 | "_originalSource": "jquery-validation"
40 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Mvc.Simple.Sample/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "2.2.0",
16 | "_release": "2.2.0",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "2.2.0",
20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5"
21 | },
22 | "_source": "git://github.com/jquery/jquery-dist.git",
23 | "_target": "2.2.0",
24 | "_originalSource": "jquery"
25 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Sample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Hosting;
7 |
8 | namespace Glimpse.AgentServer.AspNet.Sample
9 | {
10 | public class Program
11 | {
12 | public static void Main(string[] args)
13 | {
14 | var host = new WebHostBuilder()
15 | .UseKestrel()
16 | .UseContentRoot(Directory.GetCurrentDirectory())
17 | .UseIISIntegration()
18 | .UseStartup()
19 | .Build();
20 |
21 | host.Run();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Sample/Properties/debugSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Profiles": []
3 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Sample/SamplePage.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Glimpse.Internal;
3 | using Microsoft.AspNetCore.Http;
4 | using Microsoft.Net.Http.Headers;
5 |
6 | namespace Glimpse.AgentServer.AspNet.Sample
7 | {
8 | public class SamplePage
9 | {
10 | private readonly ContextData _context;
11 |
12 | public SamplePage()
13 | {
14 | _context = new ContextData();
15 | }
16 |
17 | public async Task Invoke(HttpContext context)
18 | {
19 | var response = context.Response;
20 |
21 | response.Headers[HeaderNames.ContentType] = "text/html";
22 |
23 | await response.WriteAsync($"Agent Test
");
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/sample/Glimpse.AgentServer.AspNet.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/Glimpse.Server.AspNet.Sample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Hosting;
7 |
8 | namespace Glimpse.Server.AspNet.Sample
9 | {
10 | public class Program
11 | {
12 | public static void Main(string[] args)
13 | {
14 | var host = new WebHostBuilder()
15 | .UseKestrel()
16 | .UseContentRoot(Directory.GetCurrentDirectory())
17 | .UseIISIntegration()
18 | .UseStartup()
19 | .Build();
20 |
21 | host.Run();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/sample/Glimpse.Server.AspNet.Sample/Properties/debugSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Profiles": []
3 | }
--------------------------------------------------------------------------------
/sample/Glimpse.Server.AspNet.Sample/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sample/MusicStore/Areas/Admin/Views/StoreManager/RemoveAlbum.cshtml:
--------------------------------------------------------------------------------
1 | @model MusicStore.Models.Album
2 |
3 | @{
4 | ViewBag.Title = "Delete";
5 | }
6 |
7 | @if (Model != null)
8 | {
9 | Delete Confirmation
10 |
11 |
12 | Are you sure you want to delete the album titled
13 | @Model.Title?
14 |
15 |
16 | @using (Html.BeginForm())
17 | {
18 |
19 |
20 |
21 |
22 | @Html.ActionLink("Back to List", "Index")
23 |
24 | }
25 | }
26 | else
27 | {
28 | @Html.Label(null, "Unable to locate the album")
29 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Areas/Admin/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "/Views/Shared/_Layout.cshtml";
3 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Components/CartSummaryComponent.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using Microsoft.AspNetCore.Mvc;
5 | using MusicStore.Models;
6 |
7 | namespace MusicStore.Components
8 | {
9 | [ViewComponent(Name = "CartSummary")]
10 | public class CartSummaryComponent : ViewComponent
11 | {
12 | public CartSummaryComponent(MusicStoreContext dbContext)
13 | {
14 | DbContext = dbContext;
15 | }
16 |
17 | private MusicStoreContext DbContext { get; }
18 |
19 | public async Task InvokeAsync()
20 | {
21 | var cart = ShoppingCart.GetCart(DbContext, HttpContext);
22 |
23 | var cartItems = await cart.GetCartAlbumTitles();
24 |
25 | ViewBag.CartCount = cartItems.Count;
26 | ViewBag.CartSummary = string.Join("\n", cartItems.Distinct());
27 |
28 | return View();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Components/GenreMenuComponent.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using Microsoft.AspNetCore.Mvc;
5 | using Microsoft.EntityFrameworkCore;
6 | using MusicStore.Models;
7 |
8 | namespace MusicStore.Components
9 | {
10 | [ViewComponent(Name = "GenreMenu")]
11 | public class GenreMenuComponent : ViewComponent
12 | {
13 | public GenreMenuComponent(MusicStoreContext dbContext)
14 | {
15 | DbContext = dbContext;
16 | }
17 |
18 | private MusicStoreContext DbContext { get; }
19 |
20 | public async Task InvokeAsync()
21 | {
22 | // TODO use nested sum https://github.com/aspnet/EntityFramework/issues/3792
23 | //.OrderByDescending(
24 | // g => g.Albums.Sum(a => a.OrderDetails.Sum(od => od.Quantity)))
25 |
26 | var genres = await DbContext.Genres.Select(g => g.Name).Take(9).ToListAsync();
27 |
28 | return View(genres);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Components/ISystemClock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MusicStore.Components
4 | {
5 | ///
6 | /// Abstracts the system clock to facilitate testing.
7 | ///
8 | public interface ISystemClock
9 | {
10 | ///
11 | /// Gets a DateTime object that is set to the current date and time on this computer,
12 | /// expressed as the Coordinated Universal Time(UTC)
13 | ///
14 | DateTime UtcNow { get; }
15 | }
16 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Components/SystemClock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MusicStore.Components
4 | {
5 | ///
6 | /// Provides access to the normal system clock.
7 | ///
8 | public class SystemClock : ISystemClock
9 | {
10 | ///
11 | public DateTime UtcNow
12 | {
13 | get
14 | {
15 | // The clock measures whole seconds only, and truncates the milliseconds,
16 | // because millisecond resolution is inconsistent among various underlying systems.
17 | DateTime utcNow = DateTime.UtcNow;
18 | return utcNow.AddMilliseconds(-utcNow.Millisecond);
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/sample/MusicStore/MessageServices.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace MusicStore
4 | {
5 | public static class MessageServices
6 | {
7 | public static Task SendEmailAsync(string email, string subject, string message)
8 | {
9 | // Plug in your email service
10 | return Task.FromResult(0);
11 | }
12 |
13 | public static Task SendSmsAsync(string number, string message)
14 | {
15 | // Plug in your sms service
16 | return Task.FromResult(0);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Models/Artist.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace MusicStore.Models
4 | {
5 | public class Artist
6 | {
7 | public int ArtistId { get; set; }
8 |
9 | [Required]
10 | public string Name { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Models/CartItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace MusicStore.Models
5 | {
6 | public class CartItem
7 | {
8 | [Key]
9 | public int CartItemId { get; set; }
10 |
11 | [Required]
12 | public string CartId { get; set; }
13 | public int AlbumId { get; set; }
14 | public int Count { get; set; }
15 |
16 | [DataType(DataType.DateTime)]
17 | public DateTime DateCreated { get; set; }
18 |
19 | public virtual Album Album { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Models/Genre.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace MusicStore.Models
5 | {
6 | public class Genre
7 | {
8 | public int GenreId { get; set; }
9 |
10 | [Required]
11 | public string Name { get; set; }
12 |
13 | public string Description { get; set; }
14 |
15 | public List Albums { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Models/MusicStoreContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2 | using Microsoft.EntityFrameworkCore;
3 |
4 | namespace MusicStore.Models
5 | {
6 | public class ApplicationUser : IdentityUser { }
7 |
8 | public class MusicStoreContext : IdentityDbContext
9 | {
10 | public MusicStoreContext(DbContextOptions options)
11 | : base(options)
12 | {
13 | // TODO: #639
14 | //ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
15 | }
16 |
17 | public DbSet Albums { get; set; }
18 | public DbSet Artists { get; set; }
19 | public DbSet Orders { get; set; }
20 | public DbSet Genres { get; set; }
21 | public DbSet CartItems { get; set; }
22 | public DbSet OrderDetails { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Models/OrderDetail.cs:
--------------------------------------------------------------------------------
1 | namespace MusicStore.Models
2 | {
3 | public class OrderDetail
4 | {
5 | public int OrderDetailId { get; set; }
6 |
7 | public int OrderId { get; set; }
8 |
9 | public int AlbumId { get; set; }
10 |
11 | public int Quantity { get; set; }
12 |
13 | public decimal UnitPrice { get; set; }
14 |
15 | public virtual Album Album { get; set; }
16 |
17 | public virtual Order Order { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/sample/MusicStore/MusicStoreConfig.cs:
--------------------------------------------------------------------------------
1 | namespace MusicStore
2 | {
3 | public class StoreConfig
4 | {
5 | public const string ConnectionStringKey = "Data__DefaultConnection__ConnectionString";
6 | }
7 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Properties/AppSettings.cs:
--------------------------------------------------------------------------------
1 | namespace MusicStore
2 | {
3 | public class AppSettings
4 | {
5 | public string SiteTitle { get; set; }
6 |
7 | public bool CacheDbResults { get; set; } = true;
8 | }
9 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Scripts/_references.js:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 | ///
5 | ///
6 | ///
7 | ///
8 | ///
9 |
--------------------------------------------------------------------------------
/sample/MusicStore/ViewModels/AlbumData.cs:
--------------------------------------------------------------------------------
1 | namespace MusicStore.ViewModels
2 | {
3 | public class AlbumData
4 | {
5 | public string Title { get; set; }
6 |
7 | public string Url { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/sample/MusicStore/ViewModels/ShoppingCartRemoveViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace MusicStore.ViewModels
2 | {
3 | public class ShoppingCartRemoveViewModel
4 | {
5 | public string Message { get; set; }
6 | public decimal CartTotal { get; set; }
7 | public int CartCount { get; set; }
8 | public int ItemCount { get; set; }
9 | public int DeleteId { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/sample/MusicStore/ViewModels/ShoppingCartViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using MusicStore.Models;
3 |
4 | namespace MusicStore.ViewModels
5 | {
6 | public class ShoppingCartViewModel
7 | {
8 | public List CartItems { get; set; }
9 | public decimal CartTotal { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Confirm Email";
3 | }
4 |
5 | @ViewBag.Title.
6 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/ExternalLoginFailure.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Login Failure";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 | Unsuccessful login with service.
8 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/ForgotPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model ForgotPasswordViewModel
2 | @{
3 | ViewBag.Title = "Forgot your password?";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 |
25 |
26 | @section Scripts {
27 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
28 | }
29 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/ForgotPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Forgot Password Confirmation";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/RegisterConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Register Confirmation";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
9 |
10 | Please check your email to activate your account.
11 |
12 |
13 | Demo/testing purposes only: The sample displays the code and user id in the page: Click here to confirm your email:
14 |
15 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/ResetPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Reset password confirmation";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Account/SendCode.cshtml:
--------------------------------------------------------------------------------
1 | @model SendCodeViewModel
2 | @{
3 | ViewBag.Title = "Send Verification Code";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 |
18 |
19 | @section Scripts {
20 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Checkout/AddressAndPayment.cshtml:
--------------------------------------------------------------------------------
1 | @model Order
2 |
3 | @{
4 | ViewBag.Title = "Address And Payment";
5 | }
6 |
7 | @section Scripts {
8 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Checkout/Complete.cshtml:
--------------------------------------------------------------------------------
1 | @model int
2 |
3 | @{
4 | ViewBag.Title = "Checkout Complete";
5 | }
6 |
7 | Checkout Complete
8 |
9 | Thanks for your order! Your order number is: @Model
10 |
11 |
12 | How about shopping for some more music in our
13 | Store
14 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @inject IOptions AppSettings
2 | @{
3 | ViewBag.Title = "Home Page";
4 | }
5 |
6 |
7 |
@AppSettings.Value.SiteTitle
8 |

9 |
10 |
11 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Manage/AddPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model AddPhoneNumberViewModel
2 | @{
3 | ViewBag.Title = "Add Phone Number";
4 | }
5 |
6 | @ViewBag.Title.
7 |
24 |
25 | @section Scripts {
26 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
27 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/AccessDenied.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Access denied due to insufficient permissions";
3 | }
4 |
5 | Access denied due to insufficient permissions.
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/Components/Announcement/Default.cshtml:
--------------------------------------------------------------------------------
1 | @model Album
2 |
3 | @if (Model != null)
4 | {
5 |
6 |
7 |
8 | @Model.Title
9 |
10 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/Components/CartSummary/Default.cshtml:
--------------------------------------------------------------------------------
1 | @if (ViewBag.CartCount > 0)
2 | {
3 |
4 |
5 |
6 |
7 | @ViewBag.CartCount
8 |
9 |
10 |
11 | }
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/Components/GenreMenu/Default.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 |
3 |
4 | Store
5 |
17 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/DemoLinkDisplay.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Demo link display page - Not for production use";
3 | }
4 |
5 |
6 | @ViewBag.Title.
7 |
8 |
9 |
10 | Demo link display page - Not for production use.
11 |
12 |
13 | @if (ViewBag.Link != null)
14 | {
15 |
16 | For DEMO only: You can click this link to confirm the email: [[link]]
17 |
18 | Please change this code to register an email service in IdentityConfig to send an email.
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Error";
3 | }
4 |
5 | Error.
6 | An error occurred while processing your request.
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/Lockout.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Locked Out";
3 | }
4 |
5 |
6 | Locked out.
7 | This account has been locked out, please try again later.
8 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/StatusCodePage.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Item not found";
3 | }
4 |
5 | Item not found.
6 | Unable to find the item you are searching for. Please try again.
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
14 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Store/Browse.cshtml:
--------------------------------------------------------------------------------
1 | @model Genre
2 | @{
3 | ViewBag.Title = "Browse Albums";
4 | }
5 |
6 |
7 | @Model.Name Albums
8 |
9 |
10 |
24 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Store/Details.cshtml:
--------------------------------------------------------------------------------
1 | @model Album
2 |
3 | @{
4 | ViewBag.Title = "Album - " + Model.Title;
5 | }
6 |
7 | @Model.Title
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Genre:
16 | @Model.Genre.Name
17 |
18 |
19 | Artist:
20 | @Model.Artist.Name
21 |
22 |
23 | Price:
24 |
25 |
26 |
27 | Add to cart
28 |
29 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/Store/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model IEnumerable
2 | @{
3 | ViewBag.Title = "Store";
4 | }
5 | Browse Genres
6 |
7 |
8 | Select from @Model.Count() genres:
9 |
10 |
11 | @foreach (var genre in Model)
12 | {
13 | - @genre.Name
14 | }
15 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using MusicStore
2 | @using MusicStore.Models
3 | @using Microsoft.Extensions.Options
4 | @using Microsoft.AspNetCore.Identity
5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
6 |
--------------------------------------------------------------------------------
/sample/MusicStore/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "/Views/Shared/_Layout.cshtml";
3 | }
--------------------------------------------------------------------------------
/sample/MusicStore/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "AppSettings": {
3 | "SiteTitle": "ASP.NET MVC Music Store",
4 | "CacheDbResults": true
5 | },
6 | "DefaultAdminUsername": "Administrator@test.com",
7 | "DefaultAdminPassword": "YouShouldChangeThisPassword1!",
8 | "Data": {
9 | "DefaultConnection": {
10 | // Use a shared (and running) LocalDB database when executing in IIS e.g.
11 | // "Server=(localdb)\\.\\IIS_DB;Database=MusicStore;Trusted_Connection=False;MultipleActiveResultSets=true;User ID=iis_login;Password=********"
12 | "ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=MusicStore;Trusted_Connection=True;MultipleActiveResultSets=true;Connect Timeout=30;"
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/sample/MusicStore/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/Images/home-showcase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/home-showcase.png
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/Images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/logo.png
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/Images/placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/Images/placeholder.png
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Glimpse/Glimpse.Prototype/3dce7b071f364d685dc41917c2f2139e8b7383ea/sample/MusicStore/wwwroot/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet.Mvc/Razor/RazorServices.cs:
--------------------------------------------------------------------------------
1 | using Glimpse.Agent.Razor;
2 | using Glimpse.Common.Initialization;
3 | using Microsoft.AspNetCore.Mvc.Razor;
4 | using Microsoft.Extensions.DependencyInjection;
5 |
6 | namespace Glimpse.Agent.AspNet.Mvc.Razor
7 | {
8 | public class RazorServices : IRegisterServices
9 | {
10 | public void RegisterServices(GlimpseServiceCollectionBuilder services)
11 | {
12 | services.AddTransient();
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/AgentMiddleware.cs:
--------------------------------------------------------------------------------
1 | using Glimpse.Common.Initialization;
2 | using Glimpse.Initialization;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.Extensions.DependencyInjection;
5 |
6 | namespace Glimpse.Agent
7 | {
8 | public class AgentMiddleware : IRegisterMiddleware
9 | {
10 | public void RegisterMiddleware(IApplicationBuilder appBuilder)
11 | {
12 | var manager = appBuilder.ApplicationServices.GetRequiredService();
13 | manager.Run(new StartupOptions(appBuilder));
14 |
15 | appBuilder.UseMiddleware(appBuilder);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerContentTypeProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.Extensions.Options;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | public class DefaultRequestIgnorerContentTypeProvider : IRequestIgnorerContentTypeProvider
8 | {
9 | public DefaultRequestIgnorerContentTypeProvider(IOptions optionsAccessor)
10 | {
11 | var contentTypes = optionsAccessor.Value.IgnoredContentTypes;
12 | ContentTypes = contentTypes.ToList();
13 | }
14 |
15 | public IReadOnlyList ContentTypes { get; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerStatusCodeProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.Extensions.Options;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | public class DefaultRequestIgnorerStatusCodeProvider : IRequestIgnorerStatusCodeProvider
8 | {
9 | public DefaultRequestIgnorerStatusCodeProvider(IOptions optionsAccessor)
10 | {
11 | var statusCodes = optionsAccessor.Value.IgnoredStatusCodes;
12 | StatusCodes = statusCodes.ToList();
13 | }
14 |
15 | public IReadOnlyList StatusCodes { get; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/DefaultRequestIgnorerUriProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text.RegularExpressions;
4 | using Microsoft.Extensions.Options;
5 |
6 | namespace Glimpse.Agent.Configuration
7 | {
8 | public class DefaultRequestIgnorerUriProvider : IRequestIgnorerUriProvider
9 | {
10 | public DefaultRequestIgnorerUriProvider(IOptions optionsAccessor)
11 | {
12 | var ignoredUris = optionsAccessor.Value.IgnoredUris;
13 | IgnoredUris = ignoredUris.ToList();
14 | }
15 |
16 | public IReadOnlyList IgnoredUris { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 |
3 | namespace Glimpse.Agent.Configuration
4 | {
5 | public interface IRequestIgnorer
6 | {
7 | bool ShouldIgnore(HttpContext context);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerContentTypeProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Glimpse.Agent.Configuration
4 | {
5 | public interface IRequestIgnorerContentTypeProvider
6 | {
7 | IReadOnlyList ContentTypes { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerManager.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 |
3 | namespace Glimpse.Agent.Configuration
4 | {
5 | public interface IRequestIgnorerManager
6 | {
7 | bool ShouldIgnore();
8 |
9 | bool ShouldIgnore(HttpContext context);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerStatusCodeProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Glimpse.Agent.Configuration
4 | {
5 | public interface IRequestIgnorerStatusCodeProvider
6 | {
7 | IReadOnlyList StatusCodes { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/IRequestIgnorerUriProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text.RegularExpressions;
3 |
4 | namespace Glimpse.Agent.Configuration
5 | {
6 | public interface IRequestIgnorerUriProvider
7 | {
8 | IReadOnlyList IgnoredUris { get; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/RegexExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | [EditorBrowsable(EditorBrowsableState.Never)]
8 | public static class RegexExtensions
9 | {
10 | public static void AddCompiled(this ICollection collection, string expression)
11 | {
12 | var regex = new Regex(expression, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.None);
13 | collection.Add(regex);
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerContentType.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.AspNetCore.Http;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | public class RequestIgnorerContentType : IRequestIgnorer
8 | {
9 | private readonly IReadOnlyCollection _contextType;
10 |
11 | public RequestIgnorerContentType(IRequestIgnorerContentTypeProvider requestIgnorerContentTypeProvider)
12 | {
13 | _contextType = requestIgnorerContentTypeProvider.ContentTypes;
14 | }
15 |
16 | public bool ShouldIgnore(HttpContext context)
17 | {
18 | return _contextType.Contains(context.Response.ContentType);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerOptionsShouldIgnore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.AspNetCore.Http;
3 | using Microsoft.Extensions.Options;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | public class RequestIgnorerOptionsShouldIgnore : IRequestIgnorer
8 | {
9 | private readonly Func _shouldIgnore;
10 |
11 | public RequestIgnorerOptionsShouldIgnore(IOptions optionsAccessor)
12 | {
13 | _shouldIgnore = optionsAccessor.Value.ShouldIgnore;
14 | }
15 |
16 | public bool ShouldIgnore(HttpContext context)
17 | {
18 | return _shouldIgnore != null ? _shouldIgnore(context) : false;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Configuration/RequestIgnorerStatusCode.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.AspNetCore.Http;
4 |
5 | namespace Glimpse.Agent.Configuration
6 | {
7 | public class RequestIgnorerStatusCode : IRequestIgnorer
8 | {
9 | private readonly IReadOnlyCollection _statusCodes;
10 |
11 | public RequestIgnorerStatusCode(IRequestIgnorerStatusCodeProvider requestIgnorerStatusCodeProvider)
12 | {
13 | _statusCodes = requestIgnorerStatusCodeProvider.StatusCodes;
14 | }
15 |
16 | public bool ShouldIgnore(HttpContext context)
17 | {
18 | return _statusCodes.Contains(context.Response.StatusCode);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/GlimpseAgentOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text.RegularExpressions;
4 | using Microsoft.AspNetCore.Http;
5 |
6 | namespace Glimpse.Agent
7 | {
8 | public class GlimpseAgentOptions
9 | {
10 | public GlimpseAgentOptions()
11 | {
12 | IgnoredUris = new List();
13 | IgnoredStatusCodes = new List();
14 | IgnoredContentTypes = new List();
15 | }
16 |
17 | public IList IgnoredUris { get; }
18 |
19 | public IList IgnoredStatusCodes { get; }
20 |
21 | public IList IgnoredContentTypes { get; }
22 |
23 | public Func ShouldIgnore { get; set; }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/GlimpseAgentOptionsSetup.cs:
--------------------------------------------------------------------------------
1 | using Glimpse.Agent.Configuration;
2 | using Microsoft.Extensions.Options;
3 |
4 | namespace Glimpse.Agent
5 | {
6 | public class GlimpseAgentOptionsSetup : ConfigureOptions
7 | {
8 | public GlimpseAgentOptionsSetup() : base(ConfigureGlimpseAgentWebOptions)
9 | {
10 | }
11 |
12 | public static void ConfigureGlimpseAgentWebOptions(GlimpseAgentOptions options)
13 | {
14 | // Set up IgnoredUris
15 | options.IgnoredUris.AddCompiled("^/__browserLink/requestData");
16 | options.IgnoredUris.AddCompiled("^/Glimpse"); // TODO: Need to make sure this honor overridden basePath's
17 | options.IgnoredUris.AddCompiled("^/favicon.ico");
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/GlimpseAgentServiceCollectionBuilder.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Glimpse
4 | {
5 | public class GlimpseAgentServiceCollectionBuilder : GlimpseServiceCollectionBuilder
6 | {
7 | public GlimpseAgentServiceCollectionBuilder(IServiceCollection innerCollection)
8 | : base(innerCollection)
9 | {
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/GlimpseAgentServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Microsoft.Extensions.DependencyInjection.Extensions;
3 | using System;
4 | using Glimpse.Agent;
5 |
6 | namespace Glimpse
7 | {
8 | public static class GlimpseAgentServiceCollectionExtensions
9 | {
10 | public static GlimpseAgentServiceCollectionBuilder RunningAgentWeb(this GlimpseServiceCollectionBuilder services)
11 | {
12 | return services.RunningAgentWeb(null);
13 | }
14 |
15 | public static GlimpseAgentServiceCollectionBuilder RunningAgentWeb(this GlimpseServiceCollectionBuilder services, Action setupAction)
16 | {
17 | if (setupAction != null)
18 | {
19 | services.Configure(setupAction);
20 | }
21 |
22 | return new GlimpseAgentServiceCollectionBuilder(services);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Initialization/DefaultAgentStartupManager.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Glimpse.Initialization;
4 |
5 | namespace Glimpse.Initialization
6 | {
7 | public class DefaultAgentStartupManager : IAgentStartupManager
8 | {
9 | public DefaultAgentStartupManager(IExtensionProvider startupProvider)
10 | {
11 | Startups = startupProvider.Instances;
12 | }
13 |
14 | private IEnumerable Startups { get; }
15 |
16 | public void Run(IStartupOptions options)
17 | {
18 | if (Startups.Any())
19 | {
20 | foreach (var startup in Startups)
21 | {
22 | startup.Run(options);
23 | }
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Initialization/IAgentStartup.cs:
--------------------------------------------------------------------------------
1 | using Glimpse.Initialization;
2 |
3 | namespace Glimpse.Initialization
4 | {
5 | public interface IAgentStartup
6 | {
7 | void Run(IStartupOptions options);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Initialization/IAgentStartupManager.cs:
--------------------------------------------------------------------------------
1 | namespace Glimpse.Initialization
2 | {
3 | public interface IAgentStartupManager
4 | {
5 | void Run(IStartupOptions options);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/Execute.cs:
--------------------------------------------------------------------------------
1 | namespace Glimpse.Agent.Inspectors
2 | {
3 | public enum Execute
4 | {
5 | BeforeResponse,
6 | AfterResponse
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/IInspector.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 |
3 | namespace Glimpse.Agent.Inspectors
4 | {
5 | public interface IInspector
6 | {
7 | void Before(HttpContext context);
8 |
9 | void After(HttpContext context);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunction.cs:
--------------------------------------------------------------------------------
1 | namespace Glimpse.Agent.Inspectors
2 | {
3 | public interface IInspectorFunction
4 | {
5 | void Configure(IInspectorFunctionBuilder inspectorBuilder);
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.AspNetCore.Http;
5 |
6 | namespace Glimpse.Agent.Inspectors
7 | {
8 | public interface IInspectorFunctionBuilder
9 | {
10 | IApplicationBuilder AppBuilder { get; }
11 |
12 | IInspectorFunctionBuilder Use(Func, Task> middleware);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionManager.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Builder;
2 | using Microsoft.AspNetCore.Http;
3 |
4 | namespace Glimpse.Agent.Inspectors
5 | {
6 | public interface IInspectorFunctionManager
7 | {
8 | RequestDelegate BuildInspectorBranch(RequestDelegate next, IApplicationBuilder app);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/Inspector.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 |
3 | namespace Glimpse.Agent.Inspectors
4 | {
5 | public class Inspector : IInspector
6 | {
7 | public virtual void Before(HttpContext context)
8 | {
9 | }
10 |
11 | public virtual void After(HttpContext context)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/InspectorFunctionBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.AspNetCore.Http;
5 |
6 | namespace Glimpse.Agent.Inspectors
7 | {
8 | public class InspectorFunctionBuilder : IInspectorFunctionBuilder
9 | {
10 | public InspectorFunctionBuilder(IApplicationBuilder app)
11 | {
12 | AppBuilder = app;
13 | }
14 |
15 | public IApplicationBuilder AppBuilder { get; }
16 |
17 | public IInspectorFunctionBuilder Use(Func, Task> middleware)
18 | {
19 | var newAppBuilder = AppBuilder.Use(middleware);
20 | return (newAppBuilder != AppBuilder) ? new InspectorFunctionBuilder(newAppBuilder) : this;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Inspectors/InspectorsInspectorFunction.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Glimpse.Initialization;
3 |
4 | namespace Glimpse.Agent.Inspectors
5 | {
6 | public class InspectorsInspectorFunction : IInspectorFunction
7 | {
8 | private readonly IEnumerable _inspectors;
9 |
10 | public InspectorsInspectorFunction(IExtensionProvider inspectorProvider)
11 | {
12 | _inspectors = inspectorProvider.Instances;
13 | }
14 |
15 | public void Configure(IInspectorFunctionBuilder builder)
16 | {
17 | builder.Use(async (context, next) =>
18 | {
19 | foreach (var inspector in _inspectors)
20 | {
21 | inspector.Before(context);
22 | }
23 |
24 | await next();
25 |
26 | foreach (var inspector in _inspectors)
27 | {
28 | inspector.After(context);
29 | }
30 | });
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AjaxInspector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Glimpse.Agent.Inspectors;
6 | using Glimpse.Common;
7 | using Microsoft.AspNetCore.Http;
8 | using Microsoft.Extensions.Primitives;
9 |
10 | namespace Glimpse.Agent.AspNet.Internal.Inspectors.AspNet
11 | {
12 | public class AjaxInspector : Inspector
13 | {
14 | private readonly IGlimpseContextAccessor _context;
15 |
16 | public AjaxInspector(IGlimpseContextAccessor context)
17 | {
18 | _context = context;
19 | }
20 |
21 | public override void Before(HttpContext context)
22 | {
23 | var isAjax = StringValues.Empty;
24 | if (context.Request.Headers.TryGetValue("__glimpse-isAjax", out isAjax) && isAjax == "true")
25 | {
26 | context.Response.Headers.Add("__glimpse-id", _context.RequestId.ToString("N"));
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/IExceptionProcessor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Glimpse.Agent.Messages;
4 |
5 | namespace Glimpse.Agent.Internal.Inspectors
6 | {
7 | public interface IExceptionProcessor
8 | {
9 | IEnumerable GetErrorDetails(Exception ex);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/Proxies/IDbCommand.cs:
--------------------------------------------------------------------------------
1 | namespace Glimpse.Agent.Internal.Inspectors.EF.Proxies
2 | {
3 | public interface IDbCommand
4 | {
5 | string CommandText { get; }
6 |
7 | object CommandType { get; }
8 |
9 | object Parameters { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Http;
2 |
3 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
4 | {
5 | public interface IActionContext
6 | {
7 | object ActionDescriptor { get; }
8 | HttpContext HttpContext { get; }
9 | IRouteData RouteData { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
5 | {
6 | public interface IActionDescriptor
7 | {
8 | string Id { get; }
9 | string DisplayName { get; }
10 | string ActionName { get; }
11 | string ControllerName { get; }
12 | Type ControllerTypeInfo { get; }
13 | MethodInfo MethodInfo { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionResult.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
3 | {
4 | public interface IActionResult
5 | {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IRouteData.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Collections.Generic;
3 |
4 | namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
5 | {
6 | public interface IRouteData
7 | {
8 | IReadOnlyList