using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Entidades { public class OrdenDeCompra { public int Id { get; set; } private List productos = new List(); public Proveedor Proveedor { get; set; } public void AñadirDetalle(DetalleOrdenDeCompra detalle) { productos.Add(detalle); } public bool EliminarDetalle(DetalleOrdenDeCompra detalle) { var aeliminar = productos.Find(x => x.Id == detalle.Id); if (aeliminar == null) return false; return productos.Remove(aeliminar); } public ReadOnlyCollection MostrarDetalles() { return productos.AsReadOnly(); } } }