コード例 #1
0
 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));
     });
 }
コード例 #2
0
 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));
         });
     }
 }