Exemple #1
0
        /// <summary>
        /// Save a specific entity set. Restricts/fitlers to rows present in the collection.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="toSave">EntitySet to use as a save filter.</param>
        /// <param name="settings">Optional save config settings.</param>
        /// <returns></returns>
        public static EntitySet<T> DBSave<T>(this EntitySet<T> toSave, DBSaveSettings settings = null) where T: class, new()
        {
            if (settings == null)
            {
                settings = new DBSaveSettings();
            }

            settings.SourceList = toSave;
            settings.EntityPersistName = settings.EntityPersistName ?? CEF.GetEntityPersistName<T>(toSave);
            settings.EntityPersistType = typeof(T);

            CEF.DBSave(settings);
            return toSave;
        }