mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
d
This commit is contained in:
1 parent
568f360548
commit
c4182ec609
100 files changed
+2052
-3518
No files matched your search
@@ -1,28 +1,27 @@
|
||||
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();
|
||||
//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);
|
||||
}
|
||||
// List<string> list = new List<string>();
|
||||
// foreach (var model in request)
|
||||
// {
|
||||
// list.Add(model.name);
|
||||
// }
|
||||
|
||||
return list;
|
||||
// return list;
|
||||
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user