views:

23

answers:

0

Im not so sure if this is a problem with nihibernate or linq(i would assume more linq but i may be wrong)

I Have website about boxing. There are three tables in this example

Boxer (BoxerId among other properties) Boxer_Match (holds a boxerId and MatchId - which is a composite key) Match (MatchId among other properties)

Now currently if a perform a delete on a match object

var Matchreppository = GetRepository<Match>();
var MatchToDelete = Matchreppository.Get(id);
Matchreppository.Delete(MatchToDelete)

This causes a issue as it deletes the boxers assoicated with the match... Going through the Boxer_Match table... How can I stop this happening but still make it so it removes the Boxer_Match records? (which because of their foriegn key constraints to the match table would need to be removed first)

Thanks