public LocPocQuery(ILocationsRepositoryAsync repository) { Field <ListGraphType <LocationType> >( "locations", resolve: context => repository.GetAllAsync() ); }
public CreateLocationCommandHandler(ILocationsRepositoryAsync locationsRepository, IMapper mapper) { EnsureArg.IsNotNull(locationsRepository, nameof(locationsRepository)); EnsureArg.IsNotNull(mapper, nameof(mapper)); _locationsRepository = locationsRepository; _mapper = mapper; }
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; }
public LocationsController(ILocationsRepositoryAsync locationsRepository) { _locationsRepository = locationsRepository ?? throw new ArgumentNullException(nameof(locationsRepository)); }