This file contains hidden or 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
openssl pkcs12 -export -inkey key.pem -in cert.pem -out key.pfx |
This file contains hidden or 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
{ | |
"hosts": ["tcp://0.0.0.0:2376", "npipe://"], | |
"tlsverify": true, | |
"tlscacert": "C:\\ProgramData\\docker\\certs.d\\ca.pem", | |
"tlscert": "C:\\ProgramData\\docker\\certs.d\\server-cert.pem", | |
"tlskey": "C:\\ProgramData\\docker\\certs.d\\server-key.pem" | |
} |
This file contains hidden or 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 Docker.DotNet; | |
using Docker.DotNet.Models; | |
using Docker.DotNet.X509; | |
using System; | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
namespace ContainerLauncher | |
{ | |
class Program |
This file contains hidden or 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
[HttpPost] | |
[ValidateAntiForgeryToken] | |
public ActionResult Create(MyModel myModel) | |
{ | |
// Manually validate model in every action | |
if(myModel.Item3 < myModel.Item1 + myModel.Item2) | |
{ | |
ModelState.AddModelError("Item3", "Item1 + Item2 must be less than Item3"); | |
return View(myModel); | |
} |
This file contains hidden or 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
public class MyModel : IValidatableObject | |
{ | |
[Key] | |
public int Id { get; set; } | |
public int Item1 { get; set; } | |
public int Item2 { get; set; } | |
public int Item3 { get; set; } |
This file contains hidden or 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
[HttpPost] | |
[ValidateAntiForgeryToken] | |
public ActionResult Create(MyModel myModel) | |
{ | |
// IsValid will be false due to Validate | |
if (ModelState.IsValid) | |
{ | |
db.MyModels.Add(myModel); | |
db.SaveChanges(); | |
return RedirectToAction(nameof(Index)); |
This file contains hidden or 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
public static class WardrobesList | |
{ | |
[FunctionName("WardrobesList")] | |
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); | |
var factory = new Accessors.AccessorFactory("", ""); | |
var accessor = factory.CreateWardrobeAccessor(); | |
var wardrobes = await accessor.Wardrobes(); |
This file contains hidden or 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
{"Id":1,"Season":"Fall 2017","Shirts":[{"Id":0,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/shirt_1.png","Description":"Blue Pants","Link":"http://amazon.com"},{"Id":1,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/shirt_2.png","Description":"Green Pants","Link":"http://amazon.com"},{"Id":2,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/shirt_3.png","Description":"Red Pants","Link":"http://amazon.com"},{"Id":3,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/shirt_4.png","Description":"Gray Pants","Link":"http://amazon.com"}],"Pants":[{"Id":0,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/pants_1.png","Description":"Orange Pants","Link":"http://amazon.com"},{"Id":1,"ImageUrl":"https://whateverbillhasstorage.blob.core.windows.net/whateverbillhasstatic/pants_2.png","Description":"Purple Pants","Link":"http://amazon |
This file contains hidden or 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
[FunctionName("GetWardrobe")] | |
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); | |
var wardrobe = … | |
var json = JsonConvert.SerializeObject(wardrobe, Formatting.None); | |
return new HttpResponseMessage(HttpStatusCode.OK) |
This file contains hidden or 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
getWardrobe(series: String) : Promise<Wardrobe> { | |
var url = "URL_TO_AZURE_FUNCTION"; | |
return this.http.get<Wardrobe>(url) | |
.toPromise(); | |
} |