public void DeleteCharacterByID(int id) // get all character of user
        {
            var character = _db.Character.Find(id);

            _db.Character.Remove(character);
            _db.SaveChanges();
        }
Exemple #2
0
        public void DeleteCampaign(int id)
        {
            var campaign = _db.Campaign.Find(id);

            _db.Campaign.Remove(campaign);
            _db.SaveChanges();
        }
        public void PostCampaign(Campaign campaign)
        {
            string name   = "Wesley";
            var    user   = URepo.GetUsertable().FirstOrDefault(x => x.FirstName == name);
            var    userid = user.Id;

            campaign.DungeonMasterId = user.Id;

            _context.Campaign.Add(campaign);
            _context.SaveChanges();
        }
        public void InsertUser(User credentials)
        {
            User theuser = new User
            {
                Username         = "",
                FirstName        = credentials.FirstName,
                Password         = credentials.Password,
                LastName         = "",
                Email            = "",
                RegistrationDate = DateTime.Now
            };

            _db.Add(theuser);
            _db.SaveChanges();
        }