Implemented auto assignment of foreign keys (Only EntityId as key and Id as primary key currently used)