main
Paul Schneider 10 years ago
parent dc67cd0492
commit 075095bdbe
3 changed files with 12 additions and 1 deletions

@ -11,6 +11,9 @@
</p> </p>
<table class="table"> <table class="table">
<tr> <tr>
<th>
@Html.DisplayNameFor(model => model.ApplicationID)
</th>
<th> <th>
@Html.DisplayNameFor(model => model.DisplayName) @Html.DisplayNameFor(model => model.DisplayName)
</th> </th>
@ -28,6 +31,9 @@
@foreach (var item in Model) { @foreach (var item in Model) {
<tr> <tr>
<td>
@Html.DisplayFor(modelItem => item.ApplicationID)
</td>
<td> <td>
@Html.DisplayFor(modelItem => item.DisplayName) @Html.DisplayFor(modelItem => item.DisplayName)
</td> </td>

@ -1,3 +1,4 @@
using System;
using System.Linq; using System.Linq;
using Microsoft.AspNet.Authorization; using Microsoft.AspNet.Authorization;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
@ -51,6 +52,7 @@ namespace Yavsc.Controllers
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
application.ApplicationID = Guid.NewGuid().ToString();
_context.Applications.Add(application); _context.Applications.Add(application);
_context.SaveChanges(); _context.SaveChanges();
return RedirectToAction("Index"); return RedirectToAction("Index");

@ -1,12 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc namespace Yavsc
{ {
public class Application public class Application
{ {
[Key]
public string ApplicationID { get; set; } public string ApplicationID { get; set; }
public string DisplayName { get; set; } public string DisplayName { get; set; }
public string RedirectUri { get; set; } public string RedirectUri { get; set; }
public string LogoutRedirectUri { get; set; } public string LogoutRedirectUri { get; set; }
public string Secret { get; set; } public string Secret { get; set; }
} }
} }

Loading…