コード例 #1
0
ファイル: Mutation.cs プロジェクト: bouwe77/sliq
        public async Task <AddPresentationPayload> AddPresentationAsync(
            AddPresentationInput input,
            [Service] AppDbContext context)
        {
            var presentation = new PresentationModel
            {
                Name              = input.Name,
                Code              = RandomCode.Get(),
                HasStarted        = false,
                NumberOfSlides    = 5,
                CurrentSlideIndex = 0
            };

            context.Presentations.Add(presentation);
            await context.SaveChangesAsync();

            return(new AddPresentationPayload(presentation));
        }