public async Task RemoveBusline(int id) { var busline = new Busline() { Id = id }; _context.Buslines.Remove(busline); await _context.SaveChangesAsync(); }
public async Task UpdateBusline(UpdateBuslineRequest request, int id) { var busline = new Busline() { Id = id, Number = request.Number }; _context.Buslines.Update(busline); await _context.SaveChangesAsync(); }
public async Task <Busline> AddBusline(CreateBuslineRequest request) { var busline = new Busline() { Number = request.Number }; await _context.Buslines.AddAsync(busline); await _context.SaveChangesAsync(); return(busline); }