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(); }
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; }
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; }