public async Task <ApiResultLite> UpdateAsync(ScreeningUpdateRequest request) { Screening screening = await _context.Screenings.FindAsync(request.Id); if (screening == null) { return(new ApiErrorResultLite("Không tìm thấy")); } else { screening.Id = request.Id; screening.TimeStart = request.TimeStart; //screening.Surcharge = request.Surcharge; screening.FilmId = request.FilmId; screening.RoomId = request.RoomId; screening.KindOfScreeningId = request.KindOfScreeningId; _context.Update(screening); int rs = await _context.SaveChangesAsync(); if (rs == 0) { return(new ApiErrorResultLite("Cập nhật thất bại")); } return(new ApiSuccessResultLite("Cập nhật thành công")); } }
public async Task <ApiResultLite> UpdateAsync(ScreeningUpdateRequest request) { var result = await _screeningService.UpdateAsync(request); return(result); }