Add multiple attributes in the foreign key 

Add multiple attributes in the foreign key 

  

Hello,

It is possible to add a new attribute in the foreign key, other than the Id attribute from the parent entity?

Below I added a photo with the structure of my DataModel.

When I adding a new hour I want to select for AssignmentId just the assignments that have the status "Free for execution".


So, how can I implement this business rule?


Hi,

If understand what you need this should work:

SELECT {ASSIGMENT}.[Id] FROM {ASSIGMENT} WHERE {ASSIGMENT}.[AssStatusId] = @AssStatusFreeId