using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations.Schema; namespace Entidades { public class Remito { public int Id { get; set; } private List lotesDeProductosEntregados = new List(); public Proveedor Proveedor { get; set; } public ReadOnlyCollection MostrarLotes() { return lotesDeProductosEntregados.AsReadOnly(); } public void AñadirLote(Lote lote) { try { lotesDeProductosEntregados.Add(lote); } catch (Exception) { throw; } } [NotMapped] public string NombreProveedor { get { return Proveedor.Nombre; } } } }