public async Task SearchLocationsByName(string para)
        {
            var result = await grpcClient.GetLocationsByName(new SearchParamMessage { Value = para });

            ClearLocations();
            foreach (LocationMessage l in result.Locations)
            {
                locations.Add(ConversionStuff.MessageToLocation(l));
            }
        }
Exemple #2
0
        public override Task <Empty> UpdateLocation(LocationMessage request, ServerCallContext context)
        {
            Location l = ConversionStuff.MessageToLocation(request);

            if (!ValidationUtility.IsLocationValid(l))
            {
                return(Task.FromResult(new Empty()));
            }
            unitOfWork.LocationRepo.Update(l);
            unitOfWork.Save();
            return(Task.FromResult(new Empty()));
        }
        public async Task LoadAllLocations()
        {
            var result = await grpcClient.GetAllLocations();

            ClearLocations();
            if (result == null)
            {
                return;
            }
            foreach (LocationMessage l in result.Locations)
            {
                locations.Add(ConversionStuff.MessageToLocation(l));
            }
        }