コード例 #1
0
 public void AddNewCategory()
 {
     UnitOfWork uow = new UnitOfWork();
     Category NewCat = new Category();
     NewCat.Title = "Assorted";
     NewCat.Description = "A bunch of assorted articles.";
     uow.CategoryRepository.Insert(NewCat);
     uow.Save();
 }
コード例 #2
0
 private DominoTile DrawFromCategory(Category cat)
 {
     var picture = cat.Pictures[_rand.Next(cat.Pictures.Count)];
     var picturePath = string.Format(@"../Content/gfx/pics/{0}/{1}", cat.Name, picture);
     return new DominoTile(cat.Name, picturePath);
 }