title: Cannot convert string to TimeSpan
body: <p>So, i am creating a service (using ASP.NETCore 3.1) that receives information about the operation schedule of a shop that can be registered in the system. For that i have an entity which communicates to the database and a model which communicates with this entity, as follows:</p>
  <p>Entity:</p>
  <pre><code>public class OperationSchedule
      {
          public int Id { get; set; }
          public TimeSpan Open { get; set; }
          public TimeSpan Close { get; set; }
          public DayOfWeek DatofWeek { get; set; }
      }
  </code></pre>
  <p>Model:</p>
  <pre><code>public class OperationScheduleModel
      {
          public TimeSpan Open { get; set; }
          public TimeSpan Close { get; set; }
          public DayOfWeek DatofWeek { get; set; }
      }
  </code></pre>
  <p>Of course they were already mapped using automapper. I'm using swagger to test such communications. The problem begins when i try to post a new &quot;operation schedule&quot;, swagger shows me the following output:</p>
  <p>Error converting value &quot;string&quot; to type 'System.TimeSpan'</p>
  <p>In my first attemption to resolve this problem i'd tryied to use Microsoft.AspNetCore.Mvc.NewtonsoftJson, and configured it in startup this way: <code>services.AddMvc().AddNewtonsoftJson();</code></p>
  <p>As long it does not resolved my problem i was thinking in map the types string and TimeSpan on Automapper by doing something like this:</p>
  <pre><code>public class AutoMapperProfile : Profile
      {
          public AutoMapperProfile()
          {            
              // Custom types mapping
              CreateMap&lt;string, TimeSpan&gt;.ConvertUsing&lt;StringToTimeSpanConverter&gt;();
  
              // OperationSchedule mapping
              CreateMap&lt;OperationSchedule, OperationScheduleModel&gt;();
              CreateMap&lt;OperationScheduleModel, OperationSchedule&gt;();
          }
      }
  </code></pre>
  <p>But VisualStudio isn't letting me do so, saying that a cannot use &quot;StringToTimeSpanConverter&quot; as a generic property, something like <code>ConvertUsing(new StringToTimeSpanConverter());</code> doesn't make any difference.
  I really can't even imagine another way to resolve it, but may i missing something? Help please</p>