Initial commit
This commit is contained in:
22
PartSource.Services/SecurityService.cs
Normal file
22
PartSource.Services/SecurityService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PartSource.Data;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user