Пример #1
0
 public async Task <bool> UpdateWhereCanGo(int specialistId, int[] pointsId)
 {
     context.UpdateManyToMany(
         context.WhereCanGoSpecialists.Where(x => x.SpecialistId == specialistId),
         pointsId.Select(x => new WhereCanGoSpecialist {
         SpecialistId = specialistId, WhereCanGoId = x
     }),
         x => x.WhereCanGoId);
     return(await context.SaveChangesAsync() > 0);
 }
Пример #2
0
        public async Task <bool> UpdateAnswerOrdersAsync(IEnumerable <int> answers, int orderId)
        {
            context.UpdateManyToMany(
                context.AnswerOrders.Where(x => x.OrderId == orderId),
                answers.Select(x => new AnswerOrder {
                OrderId = orderId, AnswerId = x
            }),
                x => x.AnswerId);

            return(await context.SaveChangesAsync() > 0);
        }