0
When I call my method to record, the whole object comes filled in, but when savechanges() is called it says that Idbalanca is null and yet it has the value of 1. Method Insert:
public virtual void Inserir(T item)
{
contexto.Set<T>().Add(item);
contexto.SaveChanges();
}
The Item object is filled in. See below for an image on top of the object before saving(savechanges)
The only way I could, was to create an Identity field. Without it, I got nothing.
– pnet
You want to explicitly pass the Idbalanca value instead of letting the database generate with auto-increment?
– Alisson
@Alisson, yes, because it’s in the client, but we’ll figure it out and I think Entity can do it, right? Because otherwise Entity is flawed in this sense, to work with fields not automatically generated
– pnet