Фикс для продакшена
This commit is contained in:
parent
bc540909ed
commit
b07e41e9a6
@ -6,10 +6,10 @@ public class Film
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
public string FilmName { get; set; }
|
||||
public string Cinema { get; set; }
|
||||
public string Genre { get; set; }
|
||||
public string Time { get; set; }
|
||||
public float Price { get; set; }
|
||||
public City City { get; set; }
|
||||
public string Cinema { get; set; }
|
||||
public string FilmName { get; set; }
|
||||
public string? Genre { get; set; }
|
||||
public string? Time { get; set; }
|
||||
public float Price { get; set; } = 0;
|
||||
}
|
@ -26,7 +26,7 @@ public class PublicDataService : IPublicDataService
|
||||
|
||||
public async Task<IEnumerable<Film>> GetAllFilmsInCity(string cityName)
|
||||
{
|
||||
return await _databaseContext.Films.ToListAsync();
|
||||
return await _databaseContext.Films.Where(x => x.City.Name.ToLower() == cityName.ToLower()).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateFilmsInCity(IEnumerable<FilmDto> films)
|
||||
@ -39,6 +39,8 @@ public class PublicDataService : IPublicDataService
|
||||
film.FilmName = filmDto.FilmName;
|
||||
film.Cinema = filmDto.Cinema;
|
||||
film.Price = filmDto.Price ?? 0;
|
||||
film.Genre = filmDto.Genre;
|
||||
film.Time = filmDto.Time;
|
||||
film.City = await _databaseContext.Cities.FirstOrDefaultAsync(x => x.Name == filmDto.City);
|
||||
await _databaseContext.Films.AddAsync(film);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user