24 lines
577 B
C#
24 lines
577 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using PartSource.Data;
|
|
using PartSource.Data.Contexts;
|
|
using PartSource.Data.Models;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace PartSource.Services
|
|
{
|
|
public class SecurityService
|
|
{
|
|
private readonly PartSourceContext _context;
|
|
|
|
public SecurityService(PartSourceContext context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public async Task<ApiClient> GetApiClientByKeyAsync(string key)
|
|
{
|
|
return await _context.ApiClients.FirstOrDefaultAsync(c => c.Key == key);
|
|
}
|
|
}
|
|
}
|