public void Share(string email, DGSharePermisson permission) { DGShare share = DGShare.ByEmailAndDiagram(email, ID).Single(); if (share == null) { share = new DGShare() { DiagramID = ID, Email = email }; } share.Permission = permission; share.Save(); }
public void Unshare(string email) { DGShare.ByEmailAndDiagram(email, ID).ForEach(x => x.Delete()); }