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
public class BPJSRegisterationViewModel | |
{ | |
public string NoBPJS { get; set; } | |
public string NamaPeserta { get; set; } | |
public string ValidFrom { 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
using System.ComponentModel.DataAnnotations; | |
using Microsoft.EntityFrameworkCore; | |
namespace belajarnetcoremvc.Models | |
{ | |
public class belajarDbContext :DbContext | |
{ | |
public belajarDbContext(DbContextOptions options) : base(options) | |
{ | |
} |
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 belajarnetcoremvc.Models; | |
using Microsoft.AspNetCore.Authentication.Cookies; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; |
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":{ | |
"DefaultConnection" :"server=.\\sqlexpress; database=belajarDb;user id=sa;password=[password]" | |
}, | |
"Logging": { | |
"IncludeScopes": false, | |
"LogLevel": { | |
"Default": "Warning" | |
} | |
} |
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
public class HomeController : Controller | |
{ | |
[Authorize] | |
public IActionResult Index() | |
{ | |
var roles = User.Identities; | |
return View(roles); | |
} | |
[Authorize(Roles="Penulis")] | |
public IActionResult About() |
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
class Program | |
{ | |
private static WorkDay workday1 = new WorkDay { Day = 1, DayName = "Monday" }; | |
private static WorkDay workday2 = new WorkDay { Day = 2, DayName = "Tuesday" }; | |
private static WorkDay workday3 = new WorkDay { Day = 3, DayName = "Wednesday" }; | |
private static WorkDay workday4 = new WorkDay { Day = 4, DayName = "Thursday" }; | |
private static WorkDay workday5 = new WorkDay { Day = 5, DayName = "Friday" }; | |
private static Shift shift1 = new Shift { Start = TimeSpan.Parse("08:00"), End = TimeSpan.Parse("12:00"), Name = "Shift 1" }; | |
private static Shift shift2 = new Shift { Start = TimeSpan.Parse("12:00"), End = TimeSpan.Parse("16:00"), Name = "Shift 2" }; | |
private static Shift shift3 = new Shift { Start = TimeSpan.Parse("16:00"), End = TimeSpan.Parse("20:00"), Name = "Shift 3" }; |
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; | |
namespace TodoNetCoreAngular.Models | |
{ | |
public class TodoRepository | |
{ | |
private readonly TodoDbContext context; |
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.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.SpaServices.Webpack; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; |
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.Collections.Generic; | |
using Microsoft.AspNetCore.Mvc; | |
using TodoNetCoreAngular.Models; | |
namespace TodoNetCoreAngular.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class TodoController : Controller | |
{ |
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
<h1>Todo </h1> | |
<p>This component is to run todo app.</p> | |
<p *ngIf="!todos"><em>Loading...</em></p> | |
<div class="col-md-3 input-group"> | |
<!-- <label>New todo | |
</label> --> | |
<input [(ngModel)]="todo.title" class="form-control" placeholder="New todo title."> | |
<span class="input-group-btn"> |
OlderNewer