public void Save(Adjudicacion location) { if (location.Id == default(int)) { // New entity context.Adjudicaciones.Add(location); } else { // Existing entity context.Entry(location).State = EntityState.Modified; } context.SaveChanges(); }
public void Save() { IAdjudicacionRepository repository = new AdjudicacionRepository(); IList<Licitacion> licitaciones = new List<Licitacion>(); licitaciones.Add(new Licitacion() { Proveedor = "Muebleria", Precio = new Precio("$", 1)}); licitaciones.Add(new Licitacion() { Proveedor = "Carpinteria", Precio = new Precio("$", 2) }); Adjudicacion adjudicacion = new Adjudicacion() { Entidad = "UBA", Objeto = "mesas", Texto = "hola", Licitaciones = licitaciones }; repository.Save(adjudicacion); }