44 lines
888 B
C#
44 lines
888 B
C#
using Entidades;
|
|
|
|
namespace Modelo
|
|
{
|
|
public sealed class RepositorioClientes : Repositorio<Cliente>
|
|
{
|
|
public RepositorioClientes(Context context)
|
|
{
|
|
this.context = context;
|
|
}
|
|
|
|
public IEnumerable<Cliente> Listar()
|
|
{
|
|
return context.Clientes.ToList();
|
|
}
|
|
|
|
public Cliente ObtenerPorId(int Tid)
|
|
{
|
|
Cliente cli = context.Clientes.Find(Tid);
|
|
return cli ?? new Cliente();
|
|
}
|
|
|
|
public void Add(Cliente t)
|
|
{
|
|
context.Clientes.Add(t);
|
|
}
|
|
|
|
public void Del(Cliente t)
|
|
{
|
|
Cliente cli = context.Clientes.Find(t.Cuit);
|
|
if (cli == null) return;
|
|
context.Clientes.Remove(cli);
|
|
}
|
|
|
|
public void Mod(Cliente t)
|
|
{
|
|
context.Categorias.Update(t);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|