private static void DeleteAssociations(RecruitersDataContext dc, CommunityOrganisationalUnitEntity entity) { if (entity.CommunityAssociationEntities != null && entity.CommunityAssociationEntities.Count > 0) { dc.CommunityAssociationEntities.DeleteAllOnSubmit(entity.CommunityAssociationEntities); entity.CommunityAssociationEntities.Clear(); } }
public static void MapTo(this Organisation organisation, CommunityOrganisationalUnitEntity entity) { entity.CommunityAssociationEntities = new EntitySet <CommunityAssociationEntity> { new CommunityAssociationEntity { communityId = organisation.AffiliateId.Value, organisationalUnitId = entity.id } }; }