Esempio n. 1
0
 // U - Update
 public bool UpdateLogByEmail(PokemonCaught logToUpdate)
 {
     // var log = GetLogByEmail(logToUpdate.userEmail);
     _context.Update <PokemonCaught>(logToUpdate);
     //if you don't do a check for it being 0 , then it would update all the fields
     return(_context.SaveChanges() != 0);
 }
Esempio n. 2
0
        // ----------------------------- PokeLogs ------------------//

        // C - Create
        public int CreatePokeLog(PokemonCaught newLog)
        {
            var logItem = _context.Add(newLog);

            _context.SaveChanges();
            return(logItem.Entity.id);
        }
 public bool UpdateLogByEmail(PokemonCaught logToUpdate)
 {
     return(_PokeLogsFromSQL.UpdateLogByEmail(logToUpdate));
 }
 public int CreatePokeLog(PokemonCaught logToCreate)
 {
     return(_PokeLogsFromSQL.CreatePokeLog(logToCreate));
 }