mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
29 lines
703 B
C#
29 lines
703 B
C#
using CartriX.Api.Interfaces;
|
|
using CartriX.Shared.Classes;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CartriX.Api.Services
|
|
{
|
|
public class ManufacturerService : IManufacturerService
|
|
{
|
|
private readonly AppDbContext _context;
|
|
public ManufacturerService(AppDbContext context)
|
|
{
|
|
_context = context;
|
|
}
|
|
public async Task<List<string>> GetNameListAsync()
|
|
{
|
|
var request = await _context.Manufacturers.ToListAsync();
|
|
|
|
List<string> list = new List<string>();
|
|
foreach (var model in request)
|
|
{
|
|
list.Add(model.name);
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
}
|
|
}
|