Terminado Todo lo relacionado a los repositorios
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user