示例#1
0
        public async Task <List <LocationsToScooters> > Handle(AddScooterInstances request, CancellationToken cancellationToken)
        {
            List <LocationsToScooters> link = LocationsToScooters.CreateMany(request.locationID, request.scooterInstanceIDs);

            if (link != null)
            {
                await context.LinkLocationsToScooterInstances.AddRangeAsync(link);

                await context.SaveChangesAsync(cancellationToken);

                return(link);
            }
            return(null);
        }
        public async Task <ActionResult <List <LocationsToScooters> > > AddScooterInstance([FromBody] AddScooterInstances request)
        {
            var link = await mediator.Send(request);

            return(link);
        }