Hello,
I have an entity "A" that has foreign key with another entity "B".
but why when I want to add object "A", it is required to enter values for "B" object ?
public EntityA AddEntityA (EntityA_DTO a)
{
using (var scope = new TransactionScope())
{
var obj = Mapper.Map<EntityA_DTO , EntityA >(a);
UnitOfWork.EntityA_Repository.Add(obj);
UnitOfWork.Save(); // Error Here >>
scope.Complete();
return EntityA ;
}
}Error >
Message = "Cannot insert the value NULL into column 'Name', table 'DataBase.dbo.MyTable'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated."
The Name column is in Entity B, but I need to add object for Entity A ?
I want to add parent object without child