Exemple #1
0
        public async Task <int> PutTicketUser(TicketUser ticketUser)
        {
            using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);

            context.Entry(ticketUser).State = EntityState.Modified;
            return(await context.SaveChangesAsync());
        }
Exemple #2
0
        /*public async Task<ActionResult<TicketUser>> GetTicketUser(long id)
         * {
         *  using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);
         *  var ticketUser = await context.TicketsUsers.FindAsync(id);
         *
         *  return ticketUser;
         * }*/

        public async Task <int> CreateTicketUser(TicketUser ticketUser)
        {
            using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);

            context.TicketsUsers.Add(ticketUser);
            return(await context.SaveChangesAsync());
        }
Exemple #3
0
        public async Task <int> DeleteUser(User user)
        {
            using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);

            context.Users.Remove(user);
            return(await context.SaveChangesAsync());
        }
Exemple #4
0
        public async Task <int> CreatePunchHistory(PunchHistory punchHistory)
        {
            using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);

            context.PunchingHistory.Add(punchHistory);
            return(await context.SaveChangesAsync());
        }
Exemple #5
0
        public async Task <int> DeleteStore(Store store)
        {
            using var context = new DevTicketDatabaseContext(DevTicketDatabaseContext.ops.dbOptions);

            context.Stores.Remove(store);
            return(await context.SaveChangesAsync());
        }