Terminado Todo lo relacionado a los repositorios
This commit is contained in:
@@ -5,36 +5,37 @@ namespace Modelo
|
||||
{
|
||||
public sealed class RepositorioFactura : Repositorio<Factura>
|
||||
{
|
||||
|
||||
public RepositorioFactura(Context context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public override IEnumerable<Factura> Listar()
|
||||
public override List<Factura> Listar()
|
||||
{
|
||||
return context.Facturas.ToList();
|
||||
}
|
||||
|
||||
public override Factura ObtenerPorId(int Tid)
|
||||
public Factura ObtenerPorId(int Tid)
|
||||
{
|
||||
Factura fac = context.Facturas.Find(Tid);
|
||||
Factura fac = context.Facturas.First(x => x.Id == Tid);
|
||||
return fac ?? new Factura();
|
||||
}
|
||||
|
||||
public override void Add(Factura t)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
context.Facturas.Add(t);
|
||||
}
|
||||
|
||||
public override void Del(Factura t)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
Factura fac = context.Facturas.First(x => x.Id == t.Id);
|
||||
if (fac == null) return;
|
||||
context.Facturas.Remove(fac);
|
||||
}
|
||||
|
||||
public override void Mod(Factura t)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
context.Facturas.Update(t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user