| | 1 | | using MUNity.Database.Context; |
| | 2 | | using MUNity.Database.Models.Conference; |
| | 3 | | using System; |
| | 4 | | using System.Collections.Generic; |
| | 5 | | using System.Linq; |
| | 6 | | using System.Text; |
| | 7 | | using System.Threading.Tasks; |
| | 8 | |
|
| | 9 | | namespace MUNity.Database.FluentAPI; |
| | 10 | |
|
| | 11 | | public class ConferenceTools |
| | 12 | | { |
| | 13 | | private MunityContext _dbContext; |
| | 14 | |
|
| | 15 | | public Conference AddConference(Action<ConferenceOptionsBuilder> options) |
| 1 | 16 | | { |
| 1 | 17 | | var builder = new ConferenceOptionsBuilder(_dbContext); |
| 1 | 18 | | options(builder); |
| 1 | 19 | | _dbContext.Conferences.Add(builder.Conference); |
| 1 | 20 | | _dbContext.SaveChanges(); |
| 1 | 21 | | return builder.Conference; |
| 1 | 22 | | } |
| | 23 | |
|
| 1 | 24 | | public ConferenceTools(MunityContext context) |
| 1 | 25 | | { |
| 1 | 26 | | this._dbContext = context; |
| 1 | 27 | | } |
| | 28 | | } |