0

My database has such structure: database structure

I have dates of plays and number of seats. The idea is to create list of reservations (with one date and different seats depending on number of seats) for each new date. OrderId is null until somebody will not buy a ticket on this seat.

I used code first and now i don't know how to do this:

  • Create trigger in sql server database
  • Do it in controller every time when new date is added

Or, maybe, this sctructure is bad. In this case, does exists better way?

Konstantin
  • 35
  • 3

1 Answers1

0

Actually you can't use code first for create trigget but here is an answer that provide some way to solve your problem.

Community
  • 1
  • 1
teo van kot
  • 12,350
  • 10
  • 38
  • 70