Terminado Todo lo relacionado a los repositorios

This commit is contained in:
fedpo
2024-08-15 03:22:45 +01:00
parent 4741038dd3
commit 247a19b84a
15 changed files with 228 additions and 193 deletions

View File

@@ -4,36 +4,37 @@ namespace Modelo
{
public sealed class RepositorioLote : Repositorio<Lote>
{
private Context context;
public RepositorioLote(Context context)
{
this.context = context;
}
public override IEnumerable<Lote> Listar()
public override List<Lote> Listar()
{
throw new NotImplementedException();
return context.Lotes.ToList();
}
public override Lote ObtenerPorId(int Tid)
public Lote ObtenerPorId(int Tid)
{
throw new NotImplementedException();
Lote lot = context.Lotes.First(x => x.Id == Tid);
return lot ?? new Lote();
}
public override void Add(Lote t)
{
throw new NotImplementedException();
context.Lotes.Add(t);
}
public override void Del(Lote t)
{
throw new NotImplementedException();
Lote lot = context.Lotes.First(x => x.Id == t.Id);
if (lot == null) return;
context.Lotes.Remove(lot);
}
public override void Mod(Lote t)
{
throw new NotImplementedException();
context.Lotes.Update(t);
}