コード例 #1
0
        /// <summary>
        /// Create a new EntryView object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="data">Initial value of the Data property.</param>
        public static EntryView CreateEntryView(global::System.Int32 id, global::System.Byte[] data)
        {
            EntryView entryView = new EntryView();

            entryView.Id   = id;
            entryView.Data = data;
            return(entryView);
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EntryViews EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEntryViews(EntryView entryView)
 {
     base.AddObject("EntryViews", entryView);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EntryViews EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEntryViews(EntryView entryView)
 {
     base.AddObject("EntryViews", entryView);
 }
コード例 #4
0
ファイル: Helper.cs プロジェクト: herohut/elab
        public void IndexingEntries()
        {
            var db = new NewsObjectContext();
            var indexingDb = new CachedDatabaseContainer();

            var formatter = new BinaryFormatter();

            var controller = new NouvelleController();
            var counter = 0;
            foreach (var id in db.Entries.Select(en => en.Id))
            {
                counter++;
                if (counter % 5 == 0)
                    Debug.WriteLine(">> Indexed: " + counter);
                var chk = indexingDb.EntryViews.SingleOrDefault(e => e.Id == id);
                if (chk != null)
                    continue;

                chk = new EntryView { Id = id };
                var stream = new MemoryStream();
                formatter.Serialize(stream, controller.GetEntryViewModel(id));
                chk.Data = stream.ToArray();
                indexingDb.EntryViews.AddObject(chk);
                stream.Close();


                indexingDb.SaveChanges();
            }
        }
コード例 #5
0
 /// <summary>
 /// Create a new EntryView object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="data">Initial value of the Data property.</param>
 public static EntryView CreateEntryView(global::System.Int32 id, global::System.Byte[] data)
 {
     EntryView entryView = new EntryView();
     entryView.Id = id;
     entryView.Data = data;
     return entryView;
 }