コード例 #1
0
 /// <summary>
 /// Erstellt ein neues Feature-Objekt.
 /// </summary>
 /// <param name="id">Anfangswert der Eigenschaft Id.</param>
 /// <param name="name">Anfangswert der Eigenschaft Name.</param>
 public static Feature CreateFeature(global::System.Int32 id, global::System.String name)
 {
     Feature feature = new Feature();
     feature.Id = id;
     feature.Name = name;
     return feature;
 }
コード例 #2
0
 /// <summary>
 /// Veraltete Methode zum Hinzufügen eines neuen Objekts zum EntitySet 'Features'. Verwenden Sie stattdessen die Methode '.Add' der zugeordneten Eigenschaft 'ObjectSet&lt;T&gt;'.
 /// </summary>
 public void AddToFeatures(Feature feature)
 {
     base.AddObject("Features", feature);
 }
コード例 #3
0
        protected void PreProcessFeatures()
        {
            List<string> distinctMsgFeatures = (from s in message.Sessions
                                                from fu in s.FeatureUses
                                                select fu.FeatureName).Distinct().ToList();

            if (distinctMsgFeatures.Count > 0)
            {
                List<string> knownFeatures = ImportCache.GetFeatureNames(repository);
                List<string> missing = distinctMsgFeatures.Except(knownFeatures).ToList();

                if (missing.Count > 0)
                {
                    foreach (string fn in missing)
                    {
                        Feature modelFeature = new Feature()
                        {
                            Name = fn
                        };

                        repository.Context.Features.AddObject(modelFeature);
                    }

                    repository.IgnoreDuplicateKeysOnSaveChanges<Feature>();
                    ImportCache.InvalidateFeaturesCaches();
                }
            }
        }