You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
927 B
33 lines
927 B
1 week ago
|
using WMS_GIRAF_Interface.Data;
|
||
|
using WMS_GIRAF_Interface.Entities;
|
||
|
using WMS_GIRAF_Interface.Repositories.Interface;
|
||
|
|
||
|
namespace WMS_GIRAF_Interface.Repositories.Implement;
|
||
|
|
||
|
public class IoControlRouteRepository:IIoControlRouteRepository
|
||
|
{
|
||
|
|
||
|
private readonly MichelinDbContext _context;
|
||
|
private readonly ILogger<ManageMainRepository> _logger;
|
||
|
|
||
|
public IoControlRouteRepository(MichelinDbContext context, ILogger<ManageMainRepository> logger)
|
||
|
{
|
||
|
_context = context;
|
||
|
_logger = logger;
|
||
|
}
|
||
|
|
||
|
public IO_CONTROL_ROUTE? GetIoControlRoute(int? lineNumber)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
var ioControlRoute = _context.IoControlRoute.Where(x => x.CONTROL_ROUTE_TYPE == lineNumber).FirstOrDefault();
|
||
|
return ioControlRoute;
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
_logger.LogError(ex, "Error in GetIoControlRoute");
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|