Ejemplo n.º 1
0
        public async Task <bool> UpdateLocation(LocationDTO location)
        {
            var exists = await locationRepo.Any(x => x.Id.Equals(location.Id) && x.UserId.Equals(location.UserId));

            if (exists)
            {
                if (location.ImageId == 0)
                {
                    location.ImageId = null;
                }
                await locationRepo.Update(location.ToEntity());

                return(true);
            }
            return(false);
        }
 private bool LocationExists(int id)
 {
     return(locationRepo.Any(e => e.LocationId == id));
 }