This question is locked. New answers and comments are not allowed.
Hi Team,
I don't know if this is the right place for this post. I have a tiny problem with OpenAccess and I'll appreciate it if you can help me solve it. I am sure it is a simple trick.
So basically I am using Forward Mapping ... In my model I have a class called MediaLanguage having (int Id, IList<MediaLanguageLocalization> Localizations) and another class MediaLanguageLocalization(int Id, string cultureName, string Name, string Description)
I have implemented the multiple field identity for this architecture using the IObjectId and it worked perfectly. The only problem that I have left is in the Cascade Delete ... I have set the Cascade delete option for the Localizations property but still everytime I delete my MediaLanguage entity the relevant entries from the "bc_MdLngg_bc_MdLnggLcalization" table get deleted but the entries in the table mapped to MediaLanguageLocalization remain intact..
I am deleting the MediaLanguage entity using the following function:
public void Delete(int id) |
{ |
var query = from item in Context.ObjectScope.Extent<MediaLanguage>() |
where item.Id == id |
select item; |
if (query.Count() > 0) |
{ |
var entity = query.Single(); |
Context.ObjectScope.Remove(entity); |
} |
} |
If I query the MediaLanguage that I have let's say for the english language after the deletion ... The Items are still there ... So the question is how can I make the Cascade delete to work properly ...
Appreciate it in advance.
G