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
FROM microsoft/dotnet:2.1-sdk AS build | |
WORKDIR /app | |
COPY . . | |
RUN dotnet restore | |
WORKDIR /app/Latihan.Web | |
RUN dotnet publish -c Release -o out | |
FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime |
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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="CommonServiceLocator" version="1.3" targetFramework="net462" /> | |
<package id="EntityFramework" version="6.2.0" targetFramework="net462" /> | |
<package id="Prism.Core" version="6.3.0" targetFramework="net462" /> | |
<package id="Prism.Unity" version="6.3.0" targetFramework="net462" /> | |
<package id="Prism.Wpf" version="6.3.0" targetFramework="net462" /> | |
<package id="SQLite.CodeFirst" version="1.5.1.25" targetFramework="net462" /> | |
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net462" /> | |
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net462" /> |
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 Microsoft.AspNetCore.Mvc; | |
using tracking.Models; | |
namespace tracking.Controllers | |
{ | |
public class MapController : Controller{ | |
private AirportRepository Repository; | |
public MapController(AirportRepository airport) | |
{ |
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.Http; | |
using Microsoft.AspNetCore.HttpsPolicy; | |
using Microsoft.AspNetCore.Mvc; | |
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
@{ | |
ViewData["Title"] = "Map"; | |
} | |
<h2>@ViewData["Title"]</h2> | |
@section HeadScripts{ | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css" | |
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" | |
crossorigin=""/> | |
<script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js" |
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 System.Data.SqlClient; | |
using Dapper; | |
namespace tracking.Models | |
{ | |
public class AirportRepository{ | |
// change the user id and password accordingly. | |
private const string connstring = "Data Source=.\\sqlexpress;Initial Catalog=OSM_DB;user id=[id]; password=[password]"; | |
private SqlConnection Connection; |
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
// This method gets called by the runtime. Use this method to add services to the container. | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
/// | |
/// sesuai bawaan template project | |
/// | |
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) | |
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, d => |
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
@{ | |
ViewData["Title"] = "Chat"; | |
} | |
<h2>Chat</h2> | |
<div class="container"> | |
<form id="send-form" action="#"> | |
<div class="form-group"> | |
<label>Send a message:</label> | |
<div class="input-group"> |
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 ChatHub : Hub | |
{ | |
public void Send(string message) | |
{ | |
Clients.All.SendAsync("SendMessage", Context.User.Identity.Name, message); | |
} | |
public override async Task OnConnectedAsync(){ | |
await Clients.All.SendAsync("SendAction", Context.User.Identity.Name, "joined"); | |
} |
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
<Grid > | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="1*"/> | |
</Grid.ColumnDefinitions> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="2*" MaxHeight="200" ScrollViewer.VerticalScrollBarVisibility="Auto"/> | |
<RowDefinition Height="2*" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"/> | |
</Grid.RowDefinitions> | |