Ejemplo n.º 1
0
 private void WithDates(params DateTime[] dates)
 {
     var em = new EntityMaker();
     using (var tx = DBContext.Session.BeginTransaction())
     {
         foreach (var c in dates.Select(em.CreateContent))
             DBContext.Session.Save(c);
         tx.Commit();
     }
     DBContext.Session.Clear();
 }
Ejemplo n.º 2
0
 protected IRepository<Content> ContentFactoryWithTitles(params string[] titles)
 {
     var em = new EntityMaker();
     var rep = new InMemoryRepository<Content>();
     foreach (var t in titles)
         rep.Add(em.CreateContent(t));
     return rep;
 }
Ejemplo n.º 3
0
 protected IRepository<Tag> TagFactoryWithTags(params string[] tags)
 {
     var em = new EntityMaker();
     var rep = new InMemoryRepository<Tag>();
     foreach (var t in tags)
         rep.Add(em.CreateTag(t));
     return rep;
 }