This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
namespace IHostingEnvironmentExample.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
private IHostingEnvironment _env; | |
public HomeController(IHostingEnvironment env) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using System.IO; | |
namespace IHostingEnvironmentExample | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var host = new WebHostBuilder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.FileProviders; | |
using System; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Text; | |
namespace RazorEngineViewOptionsFileProviders | |
{ | |
public class DatabaseFileInfo : IFileInfo | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Primitives; | |
using System; | |
using System.Data.SqlClient; | |
namespace RazorEngineViewOptionsFileProviders | |
{ | |
public class DatabaseChangeToken : IChangeToken | |
{ | |
private string _connection; | |
private string _viewPath; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"noImplicitAny": false, | |
"noEmitOnError": true, | |
"removeComments": false, | |
"sourceMap": true, | |
"target": "es5" | |
}, | |
"exclude": [ | |
"node_modules", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compileOnSave": true, | |
"compilerOptions": { | |
"noImplicitAny": false, | |
"noEmitOnError": true, | |
"removeComments": false, | |
"sourceMap": true, | |
"module": "amd", | |
"target": "es5" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folders": [ | |
{ | |
"id": "Inbox", | |
"mails": [ | |
{ | |
"id": 1, | |
"from": "Abbot \u003coliver@smoke-stage.xyz\u003e", | |
"to": "steve@example.com", | |
"date": "May 25, 2011", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.folders { | |
background-color: #bbb; | |
list-style-type: none; | |
padding: 0; | |
margin: 0; | |
border-radius: 7px; | |
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #d6d6d6), color-stop(0.4, #c0c0c0), color-stop(1,#a4a4a4)); | |
margin: 10px 0 16px 0; | |
font-size: 0px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page | |
@model WebMailModel | |
@{ | |
ViewData["Title"] = "WebMail"; | |
} | |
<h2>WebMail</h2> | |
<ul class="folders" data-bind="foreach: folders"> | |
<li data-bind="text: $data, | |
css: { selected: $data == $root.chosenFolderId() }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function WebmailViewModel() { | |
// Data | |
var self = this; | |
self.folders = ['Inbox', 'Archive', 'Sent', 'Spam']; | |
self.chosenFolderId = ko.observable(); | |
self.chosenFolderData = ko.observable(); | |
self.chosenMailData = ko.observable(); | |
// Behaviours | |
self.goToFolder = function(folder) { |
OlderNewer