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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
using MvcUniversity.Data; | |
using MvcUniversity.Models; | |
namespace MvcUniversity.Controllers |
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
@model MvcUniversity.Models.Instructor | |
@{ | |
ViewData["Title"] = "Edit"; | |
} | |
<h1>Edit</h1> | |
<h4>Instructor</h4> | |
<hr /> |
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
// Add students | |
Student carson = new Student | |
{ | |
FirstName = "Alexander", | |
LastName = "Carson", | |
EnrollmentDate = DateTime.Parse("2016-09-01"), | |
}; | |
Student alonso = new Student | |
{ | |
FirstName = "Meredith", |
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 MvcUniversity.Data; | |
namespace MvcUniversity.Models; | |
public class SeedData | |
{ | |
public static void Init() | |
{ | |
using (var context = new UniversityContext()) | |
{ |
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
const rootEndpoint = "https://www.thecocktaildb.com/api/json/v1/1"; | |
// Model class for a cocktail | |
export class Cocktail { | |
constructor(id, name, image, instructions) { | |
this.id = id; | |
this.name = name; | |
this.image = image; | |
this.thumbnail = image + "/preview"; | |
this.instructions = instructions; |
OlderNewer