Move licenses admin index to Blazor.

This commit is contained in:
2020-05-24 06:10:28 +01:00
parent ef8aba25ae
commit ec96aabbc4
9 changed files with 314 additions and 74 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Marechai.Database.Models;
using Microsoft.EntityFrameworkCore;
namespace Marechai.Services
{
public class LicensesService
{
readonly MarechaiContext _context;
public LicensesService(MarechaiContext context) => _context = context;
public async Task<List<License>> GetAsync() =>
await _context.Licenses.OrderBy(l => l.Name).Select(l => new License(){FsfApproved = l.FsfApproved, Id= l.Id, Link = l.Link, Name = l.Name, OsiApproved = l.OsiApproved, SPDX = l.SPDX}).ToListAsync();
}
}