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

            // did we receive environment data at all?
            if (distinctMsgEnvProperties.Count > 0)
            {
                List<string> knownDataNames = ImportCache.GetEnvironmentDataNameNames(repository);
                List<string> missing = distinctMsgEnvProperties.Except(knownDataNames).ToList();

                // this happens rarely for environment data names
                if (missing.Count > 0)
                {
                    foreach (string envdn in missing)
                    {
                        EnvironmentDataName modelEdn = new EnvironmentDataName()
                        {
                            Name = envdn
                        };

                        repository.Context.EnvironmentDataNames.AddObject(modelEdn);
                    }

                    repository.IgnoreDuplicateKeysOnSaveChanges<EnvironmentDataName>();
                    ImportCache.InvalidateEnvironmentDataNamesCaches();
                }
            }
        }