예제 #1
0
 public LocPocQuery(ILocationsRepositoryAsync repository)
 {
     Field <ListGraphType <LocationType> >(
         "locations",
         resolve: context => repository.GetAllAsync()
         );
 }
예제 #2
0
        public CreateLocationCommandHandler(ILocationsRepositoryAsync locationsRepository, IMapper mapper)
        {
            EnsureArg.IsNotNull(locationsRepository, nameof(locationsRepository));
            EnsureArg.IsNotNull(mapper, nameof(mapper));

            _locationsRepository = locationsRepository;
            _mapper = mapper;
        }
예제 #3
0
        public GetAllLocationsQueryHandler(ILocationsRepositoryAsync locationsRepository, IMapper mapper)
        {
            EnsureArg.IsNotNull(locationsRepository, nameof(locationsRepository));
            EnsureArg.IsNotNull(mapper, nameof(mapper));

            _locationsRepository = locationsRepository;
            _mapper = mapper;
        }
 public LocPocMutation(ILocationsRepositoryAsync repository, LocationMessageService messageService)
 {
     FieldAsync <LocationType>(
         "createLocation",
         arguments: new QueryArguments(
             new QueryArgument <NonNullGraphType <LocationInputType> > {
         Name = "location"
     }),
         resolve: async context =>
     {
         var location = context.GetArgument <Location>("location");
         await repository.CreateAsync(location);
         messageService.AddLocationAddedMessage(location);
         return(location);
     });
 }
        public NearestLocationsFinderServiceV1(ILocationsRepositoryAsync locationsRepository)
        {
            EnsureArg.IsNotNull(locationsRepository, nameof(locationsRepository));

            _locationsRepository = locationsRepository;
        }
예제 #6
0
 public LocationsController(ILocationsRepositoryAsync locationsRepository)
 {
     _locationsRepository = locationsRepository ?? throw new ArgumentNullException(nameof(locationsRepository));
 }