public CampaignsController(DnDEasyContext context, UserRepo urepo, CampaignRepo crepo, CharacterRepo repo) { _context = context; URepo = urepo; CRepo = crepo; Repo = repo; }
public CharacterCampaignController(CharacterRepo repo, UserRepo urepo, CampaignRepo crepo) { // _context = context; Repo = repo; URepo = urepo; CRepo = crepo; }
public UsersController(CharacterRepo characters, CharacterService charService, IUserService userService, IMapper mapper) { _mapper = mapper; _chars = characters; _charService = charService; _userService = userService; }
// GET: Character/Edit/5 public ActionResult Edit(int id) { var repo = new CharacterRepo(); Character character = repo.GetCharacter(id); characterUserId = character.UserId; return(View(character)); }
// GET: Character public ActionResult Index() { IEnumerable <Character> charList = new List <Character>(); var repo = new CharacterRepo(); charList = repo.GetAllCharacters(); charList = charList.OrderByDescending(c => c.UserId).ToList(); return(View(charList)); }
public void TestCharacterModelLoading() { //Arrange CharacterCreationViewModel ccvm = new CharacterCreationViewModel(); ICharacterContext _Icc = new TestCharacterContext(); CharacterRepo _cr = new CharacterRepo(_Icc); //Act ccvm.CharModels = _cr.GetAllCharModels(); //Assert Assert.IsTrue(ccvm.CharModels.Count == 3); }
public ActionResult Delete(int id, Character character) { try { var repo = new CharacterRepo(); repo.DeleteCharacter(id); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Character/Delete/5 public ActionResult Delete(int id) { var repo = new CharacterRepo(); Character character = repo.GetCharacter(id); if (character.UserId == 1) { return(RedirectToAction("Index")); } else { return(View(repo.GetCharacter(id))); } }
public ActionResult RandomCreate(Character character) { try { // TODO: Add insert logic here var repo = new CharacterRepo(); repo.AddRandomCharacter(character); return(RedirectToAction("Index")); } catch (Exception ex) { Console.WriteLine(ex); return(View()); } }
public ActionResult Edit(Character character) { var repo = new CharacterRepo(); if (characterUserId == 1) { if (HomeController._currentUser != null) { repo.AddCharacter(character); } } else { repo.UpdateCharacter(character); } characterUserId = null; return(RedirectToAction("Index")); }
public void TestLoadingGame() { //Arrange CharacterCreationViewModel ccvm = new CharacterCreationViewModel(); ICharacterContext _Icc = new TestCharacterContext(); IItemContext _IIc = new TestItemContext(); CharacterRepo _cr = new CharacterRepo(_Icc); ItemRepo _ir = new ItemRepo(_IIc); var mvm = new MapViewModel(); var tempItemList = new List <ItemViewModel>(); //Act mvm.character = CharacterToCharacterVM.ToCharVM(_cr.GetById(5)); foreach (Item item in _ir.GetAllItems(0)) { tempItemList.Add(ItemToItemVM.ToItemVM(item)); } mvm.allitems = tempItemList; //Assert Assert.IsTrue(mvm.character != null && mvm.character.CharacterModel != ""); Assert.IsTrue(mvm.allitems.Count > 0); }
public MapController(CharacterRepo cr, ItemRepo ir) { _cr = cr; _ir = ir; }
public CharacterService(CharacterRepo CharacterRepo, IMapper mapper) { _chars = CharacterRepo; _mapper = mapper; }
public HomeController(ILogger <HomeController> logger, DataContext dataContext) { _logger = logger; _characterRepo = new CharacterRepo(dataContext); }
public CharactersController(CharacterService charService, IMapper mapper, CharacterRepo CharacterRepo) { _mapper = mapper; _chars = CharacterRepo; _charService = charService; }
public CharacterController(CharacterRepo cr, AccountRepo ar) { _ar = ar; _cr = cr; }
public ActionResult AddImage(Image img, HttpPostedFileBase file, int id) { var repo = new CharacterRepo(); return(View("Details", repo.AddImage(img, file, id))); }
// GET: Character/Details/5 public ActionResult Details(int id) { var repo = new CharacterRepo(); return(View(repo.GetCharacter(id))); }
public ChracterAdminstrationController(CharacterRepo characters, CharacterService charService, IMapper mapper) { _mapper = mapper; _chars = characters; _charService = charService; }
public CharactersController(CharacterRepo repo) { // _context = context; Repo = repo; }
public MainWindow() { repo = new CharacterRepo(); charvm = new CharactersViewModel(repo); InitializeComponent(); }