/// <summary> /// Adds the specified tag to the specified patient. /// </summary> /// <param name="patient">The light patient dto.</param> /// <param name="tag">The search tag dto.</param> public void AddTagTo(LightPatientDto patient, SearchTagDto tag) { var entity = (from p in this.Session.Query<Patient>() where p.Id == patient.Id select p).Single(); var eTag = Mapper.Map<SearchTagDto, SearchTag>(tag); entity.SearchTags.Add(eTag); this.Session.Save(entity); }
public AddTagViewModel() { this.newSearchTag = new SearchTagDto(); this.addCommand = new RelayCommand(() => this.Add(), () => this.CanAdd()); this.closeViewCommand = new RelayCommand(() => this.Close()); }
/// <summary> /// Updates the specified search tag. /// </summary> /// <param name="item">The item.</param> public void Update(SearchTagDto item) { new Updator(this.Session).Update(item); }
/// <summary> /// Removes the specified search tag. /// </summary> /// <param name="item">The item.</param> public void Remove(SearchTagDto item) { new Remover(this.Session).Remove(item); }
/// <summary> /// Creates the specified search tag into the repository. /// </summary> /// <param name="item">The item.</param> public void Create(SearchTagDto item) { new Creator(this.Session).Create(item); }
/// <summary> /// Determines whether this instance can remove the specified search tag. /// </summary> /// <param name="item">The item.</param> /// <returns> /// <c>true</c> if this instance can remove the specified item; otherwise, <c>false</c>. /// </returns> public bool CanRemove(SearchTagDto item) { return new Remover(this.Session).CanRemove(item); }
public void Create(SearchTagDto item) { var entity = Mapper.Map<SearchTagDto, SearchTag>(item); this.Session.Save(entity); }