broken/ef
Paul Schneider 3 years ago
parent 7da74b0dfb
commit 504f431937
67 changed files with 239 additions and 96 deletions

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
namespace isn.Authorization namespace isnd.Authorization
{ {
internal class ValidApiKeyRequirement : IAuthorizationRequirement internal class ValidApiKeyRequirement : IAuthorizationRequirement
{ {

@ -1,7 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
namespace isn.Authorization namespace isnd.Authorization
{ {
internal class ValidApiKeyRequirementHandler : AuthorizationHandler<ValidApiKeyRequirement> internal class ValidApiKeyRequirementHandler : AuthorizationHandler<ValidApiKeyRequirement>
{ {

@ -1,4 +1,4 @@
namespace isn namespace isnd
{ {
public static class Constants public static class Constants
{ {

@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using isn.Data; using isnd.Data;
using isn.Data.Roles; using isnd.Data.Roles;
using System; using System;
using System.Linq; using System.Linq;
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace isn.Controllers namespace isnd.Controllers
{ {
[AllowAnonymous] [AllowAnonymous]
public class AccountController : Controller public class AccountController : Controller

@ -10,12 +10,12 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using isn.Data; using isnd.Data;
using isn.Entities; using isnd.Entities;
using isn.Data.ApiKeys; using isnd.Data.ApiKeys;
namespace isn.Controllers namespace isnd.Controllers
{ {
[Authorize] [Authorize]
public class ApiKeysController : Controller public class ApiKeysController : Controller

@ -2,10 +2,10 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using isn.Entities; using isnd.Entities;
using isn.Data; using isnd.Data;
using System.Linq; using System.Linq;
using isn.ViewModels; using isnd.ViewModels;
using Unleash.ClientFactory; using Unleash.ClientFactory;
using Unleash; using Unleash;
using isnd.Entities; using isnd.Entities;
@ -13,7 +13,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using isnd.Helpers; using isnd.Helpers;
namespace isn.Controllers namespace isnd.Controllers
{ {
public class HomeController : Controller public class HomeController : Controller
{ {

@ -1,9 +1,9 @@
using System; using System;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using isn.Data; using isnd.Data;
namespace isn.Controllers namespace isnd.Controllers
{ {
public class NewUpdateController : Controller public class NewUpdateController : Controller

@ -4,10 +4,10 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using isn.Data; using isnd.Data;
using isn.ViewModels; using isnd.ViewModels;
namespace isn namespace isnd
{ {
[AllowAnonymous] [AllowAnonymous]
public class PackageVersionController : Controller public class PackageVersionController : Controller

@ -11,11 +11,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NuGet.Packaging.Core; using NuGet.Packaging.Core;
using NuGet.Versioning; using NuGet.Versioning;
using isn.Data; using isnd.Data;
using isn.Helpers; using isnd.Helpers;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
namespace isn.Controllers namespace isnd.Controllers
{ {
public partial class PackagesController public partial class PackagesController

@ -8,8 +8,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using NuGet.Versioning; using NuGet.Versioning;
using isn.Data; using isnd.Data;
using isn.Entities; using isnd.Entities;
using Unleash.ClientFactory; using Unleash.ClientFactory;
using Unleash; using Unleash;
using System.Collections.Generic; using System.Collections.Generic;
@ -17,8 +17,10 @@ using isnd.Services;
using isnd.Entities; using isnd.Entities;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using isnd.Helpers; using isnd.Helpers;
using isnd.ViewModels;
using System.Threading.Tasks;
namespace isn.Controllers namespace isnd.Controllers
{ {
[AllowAnonymous] [AllowAnonymous]
@ -60,6 +62,42 @@ namespace isn.Controllers
// GET {@id}?q={QUERY}&skip={SKIP}&take={TAKE}&prerelease={PRERELEASE}&semVerLevel={SEMVERLEVEL}&packageType={PACKAGETYPE} // GET {@id}?q={QUERY}&skip={SKIP}&take={TAKE}&prerelease={PRERELEASE}&semVerLevel={SEMVERLEVEL}&packageType={PACKAGETYPE}
// GET: PackageVersion
public async Task<IActionResult> Index(PackageIndexViewModel model)
{
var applicationDbContext = _dbContext.Packages.Include(p => p.Versions).Where(
p => ( model.Prerelease || p.Versions.Any(v => !v.IsPrerelease))
&& ((model.query == null) || p.Id.StartsWith(model.query)));
model.data = await applicationDbContext.ToArrayAsync();
return View(model);
}
// GET: PackageVersion/Details/5
public async Task<IActionResult> Details(string pkgid)
{
if (pkgid == null)
{
return NotFound();
}
var packageVersion = _dbContext.PackageVersions
.Include(p => p.Package)
.Where(m => m.PackageId == pkgid)
.OrderByDescending(p => p)
;
if (packageVersion == null)
{
return NotFound();
}
bool results = await packageVersion.AnyAsync();
var latest = await packageVersion.FirstAsync();
return View("Details", new PackageDetailViewModel { latest = latest, pkgid = pkgid, totalHits = packageVersion.Count(), data = packageVersion.Take(10).ToArray() } );
}
[HttpGet("~/index.json")] [HttpGet("~/index.json")]
public IActionResult ApiIndex() public IActionResult ApiIndex()
{ {

@ -1,4 +1,4 @@
namespace isn.Controllers namespace isnd.Controllers
{ {
internal class Resource internal class Resource
{ {

@ -2,7 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
namespace isn.Controllers namespace isnd.Controllers
{ {
internal class SafeNameAttribute : ValidationAttribute internal class SafeNameAttribute : ValidationAttribute
{ {

@ -4,7 +4,7 @@
using System; using System;
namespace isn.Data namespace isnd.Data
{ {
public class AccountOptions public class AccountOptions
{ {

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace isn.Data namespace isnd.Data
{ {
public class ExternalProvider public class ExternalProvider
{ {

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace isn.Data namespace isnd.Data
{ {
public class LoggedOutViewModel public class LoggedOutViewModel
{ {

@ -4,7 +4,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace isn.Data namespace isnd.Data
{ {
public class LoginInputModel public class LoginInputModel
{ {

@ -6,7 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace isn.Data namespace isnd.Data
{ {
public class LoginViewModel : LoginInputModel public class LoginViewModel : LoginInputModel
{ {

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace isn.Data namespace isnd.Data
{ {
public class LogoutInputModel public class LogoutInputModel
{ {

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
namespace isn.Data namespace isnd.Data
{ {
public class LogoutViewModel : LogoutInputModel public class LogoutViewModel : LogoutInputModel
{ {

@ -3,7 +3,7 @@
namespace isn.Data namespace isnd.Data
{ {
public class RedirectViewModel public class RedirectViewModel
{ {

@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace isn.Data namespace isnd.Data
{ {
public class RegisterViewModel public class RegisterViewModel
{ {

@ -2,7 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class ApiKey public class ApiKey
{ {

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class ApiKeyViewModel public class ApiKeyViewModel
{ {

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class CreateModel public class CreateModel
{ {

@ -1,4 +1,4 @@
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class DeleteModel public class DeleteModel
{ {

@ -1,4 +1,4 @@
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class DetailModel : ApiKeyViewModel public class DetailModel : ApiKeyViewModel
{ {

@ -1,4 +1,4 @@
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class EditModel public class EditModel
{ {

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace isn.Data.ApiKeys namespace isnd.Data.ApiKeys
{ {
public class IndexModel public class IndexModel
{ {

@ -4,10 +4,10 @@ using System.Text;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using isn.Data; using isnd.Data;
using isn.Data.ApiKeys; using isnd.Data.ApiKeys;
namespace isn.Data namespace isnd.Data
{ {
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{ {

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
namespace isn.Data namespace isnd.Data
{ {
// Add profile data for application users by adding properties to the ApplicationUser class // Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser public class ApplicationUser : IdentityUser

@ -1,6 +1,6 @@
using System; using System;
namespace isn.Data namespace isnd.Data
{ {
public class NewReleaseInfo public class NewReleaseInfo
{ {

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace isn.Data namespace isnd.Data
{ {
public class Package public class Package
{ {

@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace isn.Data namespace isnd.Data
{ {
public class PackageVersion public class PackageVersion
{ {

@ -1,4 +1,4 @@
namespace isn.Data.Roles namespace isnd.Data.Roles
{ {
public class AdminStartupList public class AdminStartupList
{ {

@ -1,4 +1,4 @@
namespace isn.Entities namespace isnd.Entities
{ {
public class IsndSettings public class IsndSettings
{ {

@ -1,4 +1,4 @@
namespace isn.Entities namespace isnd.Entities
{ {
public class SmtpSettings public class SmtpSettings
{ {

@ -1,7 +1,7 @@
using System; using System;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace isn.Data namespace isnd.Data
{ {
public static class Extensions public static class Extensions
{ {

@ -2,7 +2,7 @@ using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using NuGet.Packaging.Core; using NuGet.Packaging.Core;
namespace isn.Helpers namespace isnd.Helpers
{ {
public static class NuspecCoreReaderHelpers public static class NuspecCoreReaderHelpers
{ {

@ -1,7 +1,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
namespace isn.Interfaces namespace isnd.Interfaces
{ {
public interface IMailer public interface IMailer
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using isn.Data; using isnd.Data;
namespace isndhost.Migrations namespace isndhost.Migrations
{ {

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace isn namespace isnd
{ {
public class Program public class Program
{ {

@ -8,10 +8,10 @@ using MailKit.Net.Smtp;
using MimeKit; using MimeKit;
using System; using System;
using isn.Interfaces; using isnd.Interfaces;
using isn.Entities; using isnd.Entities;
namespace isn.Services namespace isnd.Services
{ {
public class EmailSender : IEmailSender, IMailer public class EmailSender : IEmailSender, IMailer
{ {

@ -1,8 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using isn.Controllers; using isnd.Controllers;
using isn.Data; using isnd.Data;
using isn.ViewModels;
using isnd.ViewModels; using isnd.ViewModels;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NuGet.Versioning; using NuGet.Versioning;
@ -34,6 +33,7 @@ namespace isnd.Services
return new PackageIndexViewModel return new PackageIndexViewModel
{ {
query = query,
totalHits = total, totalHits = total,
data = pkgs data = pkgs
}; };

@ -1,4 +1,4 @@
using isn.Data; using isnd.Data;
namespace isnd.Services namespace isnd.Services
{ {

@ -6,12 +6,12 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using isn.Data; using isnd.Data;
using isn.Interfaces; using isnd.Interfaces;
using isn.Services; using isnd.Services;
using isn.Entities; using isnd.Entities;
using isn.Authorization; using isnd.Authorization;
using isn.Data.Roles; using isnd.Data.Roles;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Unleash; using Unleash;
using System.Collections.Generic; using System.Collections.Generic;
@ -22,7 +22,7 @@ using Microsoft.Extensions.Options;
using isnd.Helpers; using isnd.Helpers;
using isnd.Services; using isnd.Services;
namespace isn namespace isnd
{ {
public class Startup public class Startup
{ {
@ -110,7 +110,7 @@ namespace isn
{ {
routes.MapRoute( routes.MapRoute(
name: "default", name: "default",
template: "{controller=PackageVersion}/{action=Index}/{PackageId?}"); template: "{controller=Packages}/{action=Index}/{query?}");
}); });
} }
} }

@ -1,6 +1,6 @@
using Unleash; using Unleash;
namespace isn.ViewModels namespace isnd.ViewModels
{ {
public class HomeIndexViewModel public class HomeIndexViewModel
{ {

@ -0,0 +1,15 @@
using isnd.Data;
namespace isnd.ViewModels
{
public class PackageDetailViewModel
{
public PackageVersion latest { get; set; }
public string pkgid { get; set; }
public int totalHits { get; set; }
public PackageVersion[] data { get; set; }
}
}

@ -1,11 +1,12 @@
using isn.Data; using isnd.Data;
namespace isnd.ViewModels namespace isnd.ViewModels
{ {
public class PackageIndexViewModel public class PackageIndexViewModel
{ {
public bool Prerelease { get; set; }
public Package[] data {get; set;} public Package[] data {get; set;}
public string Query { get; set; } public string query { get; set; }
public int totalHits { get; internal set; } public int totalHits { get; internal set; }
} }
} }

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using isn.Data; using isnd.Data;
namespace isn.ViewModels namespace isnd.ViewModels
{ {
public class PackageVersionIndexViewModel public class PackageVersionIndexViewModel
{ {

@ -1,5 +1,5 @@
@model isn.Data.ApiKeys.CreateModel @model isnd.Data.ApiKeys.CreateModel
@{ @{
ViewData["Title"] = "Create"; ViewData["Title"] = "Create";

@ -1,5 +1,5 @@
@model isn.Data.ApiKeys.DeleteModel @model isnd.Data.ApiKeys.DeleteModel
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";

@ -1,5 +1,5 @@
@model isn.Data.ApiKeys.DetailModel @model isnd.Data.ApiKeys.DetailModel
@{ @{
ViewData["Title"] = "Details"; ViewData["Title"] = "Details";

@ -1,5 +1,5 @@
@model isn.Data.ApiKeys.EditModel @model isnd.Data.ApiKeys.EditModel
@{ @{
ViewData["Title"] = "Edit"; ViewData["Title"] = "Edit";

@ -1,5 +1,5 @@
@model isn.Data.ApiKeys.IndexModel @model isnd.Data.ApiKeys.IndexModel
@{ @{
ViewData["Title"] = "Index"; ViewData["Title"] = "Index";

@ -8,7 +8,7 @@
<h1 class="display-4">Welcome</h1> <h1 class="display-4">Welcome</h1>
<h1> <h1>
<img src="~/icon.jpg"> <img src="~/icon.jpg">
Welcome to isn Welcome to isnd
</h1> </h1>
<strong>@Model.PkgCount identifiant(s) de paquet dans le SI</strong> <strong>@Model.PkgCount identifiant(s) de paquet dans le SI</strong>

@ -1,4 +1,4 @@
@model isn.Data.PackageVersion @model isnd.Data.PackageVersion
@{ @{
ViewData["Title"] = "Delete"; ViewData["Title"] = "Delete";

@ -1,4 +1,4 @@
@model isn.Data.PackageVersion @model isnd.Data.PackageVersion
@{ @{
ViewData["Title"] = "Details"; ViewData["Title"] = "Details";

@ -0,0 +1,37 @@
@model PackageDetailViewModel
@{
ViewData["Title"] = "Details";
}
<h2>Details</h2>
<div>
<h4>PackageVersion</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.latest.IsPrerelease)
</dt>
<dd>
@Html.DisplayFor(model => model.latest.IsPrerelease)
</dd>
<dt>
@Html.DisplayNameFor(model => model.latest.PackageId)
</dt>
<dd>
@Html.DisplayFor(model => model.latest.PackageId)
</dd>
<dt>
@Html.DisplayNameFor(model => model.latest.FullString)
</dt>
<dd>
<a href="@Model.latest.NugetLink" >@Html.DisplayFor(model => model.latest.FullString)</a>
<a href="@Model.latest.NuspecLink" >nuspec</a>
</dd>
</dl>
</div>
<div>
@Html.ActionLink("Edit", "Edit", new { pkgid = Model.pkgid, version = Model.latest.FullString }) |
<a asp-action="Index">Back to List</a>
</div>

@ -0,0 +1,53 @@
@model PackageIndexViewModel
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p>
<form method="get">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="query" class="control-label"></label>
<input asp-for="query" class="form-control" />
<label asp-for="totalHits" class="control-label"></label>
</div>
<div class="form-group">
<input type="submit" value="Find" class="btn btn-default" />
</div>
</form>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.data[0].Id)
</th>
<th>
@Html.DisplayNameFor(model => model.data[0].Description)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.data) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.ActionLink("Details", "Details", new { pkgid = item.Id }) |
@Html.ActionLink("Delete", "Delete", new { pkgid = item.Id })
</td>
</tr>
}
</tbody>
</table>

@ -1,3 +1,3 @@
@using isn.Data @using isnd.Data
@using isn.ViewModels @using isnd.ViewModels
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

@ -1,9 +1,8 @@
using System; using System;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore; using Microsoft.AspNetCore;
using isn;
using Xunit; using Xunit;
using isn.Data; using isnd.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

Loading…