title: Best approach dealing with logical delete and automapper
body: <p>my api should not expose deleted data to clients and i´m confused dealing with soft delete and automapper.</p>
  <p>i don´t know if my approach is correct, but my intention is not map deleted data.
  What´s best approach dealing with logical delete and automapper?</p>
  <p>here´s my scenario:</p>
  <p>Source classes:</p>
  <pre><code>public class Project
  {
   public int ProjectId { get; set; }
   public string Name { get; set; }
   public Person Manager { get; set; }
   public ICollection&lt;Person&gt; Team { get; set; }
   public DateTime startDate { get; set; }
   public DateTime endDate { get; set; }
  }
  public class Person
  {
   public int PersonId { get; set; }
   public string Name { get; set; }
   public string Email { get; set; }
   public bool IsDeleted { get; set; } = false;
  }
  </code></pre>
  <p>Destination class:</p>
  <pre><code>public class ProjectDTO
  {
   public int ProjectId { get; set; }
   public string Name { get; set; }
   public PersonDTO Manager { get; set; }
   public ICollection&lt;PersonDTO&gt; Team { get; set; }
  }
  public class PersonDTO
  {
   public int PersonId { get; set; }
   public string Name { get; set; }
   public string Email { get; set; }
  }
  </code></pre>
  <p>Here´s the mapping setup i´m using...</p>
  <pre><code>CreateMap&lt;Person, PersonDTO&gt;().ForAllMembers(o =&gt; o.PreCondition(p =&gt; p.IsDeleted == false));
  CreateMap&lt;Project, ProjectDTO&gt;();
  </code></pre>
  <p>(this results null maps when Manager was soft-deleted)</p>
  <p>Does this architecture make sense?</p>