Example #1
0
        public async Task UpdateRelation(UpdateRelationDTO input)
        {
            Relation result = await _relationRepository.GetById(input.Id);

            if (input.ArtifactId != Guid.Empty)
            {
                result.Artifact = await _artifactRepository.GetById(input.ArtifactId);

                result.Location = result.Artifact.Location;
            }
            if (input.BeaconId != Guid.Empty)
            {
                result.Beacon = await _beaconRepository.GetById(input.BeaconId);
            }
            if (input.ContentId != Guid.Empty)
            {
                result.Content = await _contentRepository.GetById(input.ContentId);
            }
            if (!String.IsNullOrEmpty(input.Proximity))
            {
                result.Proximity = (Proximity)Enum.Parse(typeof(Proximity), input.Proximity, true);
            }

            var artifact = await _artifactRepository.GetAll()
                           .Include(x => x.Location)
                           .Where(x => x.Id == input.Id)
                           .FirstOrDefaultAsync();

            result.Location = artifact.Location;

            await _relationRepository.Update(input.Id, result);
        }
Example #2
0
 public async Task UpdateRelation(UpdateRelationDTO input)
 {
     try
     {
         await _relationService.UpdateRelation(input);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public void UpdateRelation(UpdateRelationDTO input)
 {
     _relationService.UpdateRelation(input);
 }