Not even sure how to search for something like this, but for example:
First Table:
Id, Date, Maximum records
Second Table:
Id, Date, more properties
Is it possible to define some rules on the server side, if the second Table has too many records with the same date and it exceeds the maximum records value for the current date from the First Table then the server would throw back an error or some kinda exception that would prevent an sql insert query for that date?
Possible:
First Table:
1,Date1,2
Second Table:(Maximum 2 on Date 1)
1,Date3,...
2,Date1,...
3,Date1,...
Not possible:
First Table:
1,Date1,2
Second Table:(Maximum 2 on Date 1)
1,Date3,...
2,Date1,...
3,Date1,...
4,Date1,...
If it is not possible to do this then what would be the best way to achieve this type of checking on an windows forms application with entity framework?