title: How to make Generic method in C#
body: <p>I have a lot of methods like these in a serviceContract I'm making:</p>
  
  <pre><code>   TemplateContract CreateTemplateContract(Template t)
      {
          return new TemplateContract()
          {
              Id = t.Id,
              Name = t.Name,
              Description = t.Description,
              DataLayoutId = t.DataLayoutId,
              FieldLayoutId = t.FieldLayoutId,
              SheetId = t.SheetId,
              ThemeId = t.ThemeId
          };
      }
  
      Template CreateTemplate(TemplateContract t)
      {
          return new Template()
          {
              Id = t.Id,
              Name = t.Name,
              Description = t.Description,
              DataLayoutId = t.DataLayoutId,
              FieldLayoutId = t.FieldLayoutId,
              SheetId = t.SheetId,
              ThemeId = t.ThemeId
          };
      }
  </code></pre>
  
  <p>These are methods to translate POCO's to DTO's and the other way around,
  I was wondering if I could some of these generic, it would be a lot cleaner, but I haven't got a lot of experience in generic Coding and couldn't quiet figure it out yet</p>