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; |
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
* text=auto | |
# Unity files | |
*.meta -text -merge=unityamlmerge | |
*.unity -text -merge=unityamlmerge | |
*.asset -text -merge=unityamlmerge | |
*.prefab -text -merge=unityamlmerge | |
# Image formats | |
*.psd filter=lfs diff=lfs merge=lfs -text |
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
// 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 System; | |
using System.Linq; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using MvcUniversity.Models; | |
namespace MvcUniversity.Data | |
{ | |
public static class SeedData | |
{ |
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
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using MvcUniversity.Models; | |
namespace MvcUniversity.Data | |
{ | |
public static class SeedData |
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
import AsyncStorage from "@react-native-async-storage/async-storage"; | |
export interface Todo { | |
task: string; | |
completed: boolean; | |
} | |
class TodoService { | |
// Return all todos asynchronously. Returns a Promise | |
async getAll(): Promise<Array<Todo>> { |
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
export interface Todo { | |
task: string; | |
completed: boolean; | |
} | |
class TodoService { | |
private todos: Array<Todo> = []; | |
// Return all todos asynchronously. Returns a Promise | |
getAll(): Promise<Array<Todo>> { |
NewerOlder