示例#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));
        }