Jest to prawdopodobnie największy problem ze stratą czasu, nad rozwiązaniem którego spędziłem godziny.
var db = new hublisherEntities();
establishment_brands est = new establishment_brands();
est.brand_id = 1;
est.establishment_id = 1;
est.price = collection["price"];
est.size = collection["size"];
db.establishment_brands.Add(est);
db.SaveChanges();
To daje mi błąd
Wartość nie może być pusta. Nazwa parametru: źródło
stacktrace of
[ArgumentNullException: Value nie może być null. Nazwa parametru: źródło] System.Linq.Enumerable.Any (
1 source, Funcpredykat IEnumerable 2) +4083335 System.Data.Entity.Internal.InternalContext.WrapUpdateException (UpdateException updateException) +87
System.Data.Entity.Internal.InternalContext.SaveChanges () + 193
System.Data.Entity.Internal.LazyInternalContext.SaveChanges () +33
System.Data.Entity.DbContext.SaveChanges () +20 ... ...
Chcę tylko dodać jednostkę do tabeli. ORM to EF.