private void UpdateFeatures(List <Guid> features, bool deleteExisting = false) { if (deleteExisting) { this.PermissionFeatures.Clear(); } features.Distinct().ToList().ForEach(a => { if (PermissionFeatures == null) { PermissionFeatures = new List <PermissionFeature>(); } PermissionFeatures.Add(new PermissionFeature(this.Id, a)); }); }
public Permission(string label, string description, Guid createdBy, List <Guid> features = null) { Label = label; Description = label; CreatedBy = createdBy; if (features != null) { features.Distinct().ToList().ForEach(a => { if (PermissionFeatures == null) { PermissionFeatures = new List <PermissionFeature>(); } PermissionFeatures.Add(new PermissionFeature(this.Id, a)); }); } }