Ejemplo n.º 1
0
 /// <summary>
 /// Create a new AppSetting object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="value">Initial value of the Value property.</param>
 public static AppSetting CreateAppSetting(global::System.Int32 id, global::System.String name, global::System.String value)
 {
     AppSetting appSetting = new AppSetting();
     appSetting.Id = id;
     appSetting.Name = name;
     appSetting.Value = value;
     return appSetting;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Update the recorded Id of the most recent tweet
        /// </summary>
        private void UpdateLastTweetId(IEnumerable<Tweet> tweets)
        {
            if (_lastTweetId == null)
            {
                //Get from DB
                _lastTweetId = _context.AppSettings.FirstOrDefault(s => s.Name == "LastTweetId");
            }

            if (tweets.Any())
            {
                _lastTweetId.Value = Math.Max(int.Parse(_lastTweetId.Value), tweets.Max(t => t.Id)).ToString();
                _context.SaveChanges();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the AppSettings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAppSettings(AppSetting appSetting)
 {
     base.AddObject("AppSettings", appSetting);
 }