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 EventEmitter = require('events'); | |
class MyEmitter extends EventEmitter {} | |
const myEmitter = new MyEmitter(); | |
myEmitter.on('event', () => { | |
console.log('an event occurred!'); | |
}); | |
myEmitter.emit('event'); |
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
dotnet new webapp -o SmartSchools | |
cd SmartSchools | |
dotnet run |
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; | |
namespace SmartSchools.Models | |
{ | |
public class Siswa | |
{ | |
public int ID { get; set; } | |
public string NamaLengkap { get; set; } | |
} | |
} |
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
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design | |
dotnet restore | |
dotnet ef migrations add InitialCreate | |
dotnet ef database update |
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
dotnet aspnet-codegenerator razorpage -m Siswa -dc SiswaContext -udl -outDir Pages/Siswas --referenceScriptLibraries |
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
{ | |
"ConnectionStrings": { | |
"SmartSchoolsContext": "Server=<dockerIP-SQLServer>;Database=<youdatabase>;User Id=SA;Password=<strongpassword1>" | |
} | |
} |
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
namespace RazorPagesMovie.Models | |
{ | |
public class SiswaContext : DbContext | |
{ | |
public SiswaContext(DbContextOptions<siswacontext> options) : base(options) | |
{ | |
} | |
public DbSet<siswa> Siswa { get; set; } | |
} |
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
sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \ | |
-p 1433:1433 --name sql1 \ | |
-d microsoft/mssql-server-linux:2017-latest |
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
sudo docker pull microsoft/mssql-server-linux:2017-latest |
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
sudo docker ps -a |