title: How to merge 2 List<T> and removing duplicate values from it in C#
body: <p>I have two lists List that I need to combine in third list and remove duplicate values from that lists</p>
  
  <p>A bit hard to explain, so let me show an example of what the code looks like and what I want as a result, in sample I use int type not ResultAnalysisFileSql class.</p>
  
  <p>first_list = [1, 12, 12, 5]</p>
  
  <p>second_list = [12, 5, 7, 9, 1]</p>
  
  <p>The result of combining the two lists should result in this list:
  resulting_list = [1, 12, 5, 7, 9]</p>
  
  <p>You'll notice that the result has the first list, including its two "12" values, and in second_list has an additional 12, 1 and 5 value.</p>
  
  <p>ResultAnalysisFileSql class</p>
  
  <pre><code>[Serializable]
      public partial class ResultAnalysisFileSql
      {
          public string FileSql { get; set; }
  
          public string PathFileSql { get; set; }
  
          public List&lt;ErrorAnalysisSql&gt; Errors { get; set; }
  
          public List&lt;WarningAnalysisSql&gt; Warnings{ get; set; }
  
          public ResultAnalysisFileSql()
          {
  
          }
  
          public ResultAnalysisFileSql(string fileSql)
          {
              if (string.IsNullOrEmpty(fileSql)
                  || fileSql.Trim().Length == 0)
              {
                  throw new ArgumentNullException("fileSql", "fileSql is null");
              }
  
              if (!fileSql.EndsWith(Utility.ExtensionFicherosErrorYWarning))
              {
                  throw new ArgumentOutOfRangeException("fileSql", "Ruta de fichero Sql no tiene extensión " + Utility.ExtensionFicherosErrorYWarning);
              }
  
              PathFileSql = fileSql;
              FileSql = ObtenerNombreFicheroSql(fileSql);
              Errors = new List&lt;ErrorAnalysisSql&gt;();
              Warnings= new List&lt;WarningAnalysisSql&gt;();
          }
  
          private string ObtenerNombreFicheroSql(string fileSql)
          {
              var f = Path.GetFileName(fileSql);
              return f.Substring(0, f.IndexOf(Utility.ExtensionFicherosErrorYWarning));
          }
  
  
          public override bool Equals(object obj)
          {
              if (obj == null)
                  return false;
              if (!(obj is ResultAnalysisFileSql))
                  return false;
  
              var t = obj as ResultAnalysisFileSql;
              return t.FileSql== this.FileSql
                  &amp;&amp; t.PathFileSql == this.PathFileSql
                  &amp;&amp; t.Errors.Count == this.Errors.Count
                  &amp;&amp; t.Warnings.Count == this.Warnings.Count;
          }
  
  
      }
  </code></pre>
  
  <p>Any sample code for combine and removing duplicates ?</p>