title: Conversion error in Entity Framework
body: <p>I'm new to Entity Framework. I'm trying to retrieve data from the database using a LINQ query and Entity Framework.</p>
  
  <pre><code>IEnumerable&lt;Gate&gt; lstGate = from tbsite in dc.tblSites
                              select new Gate
                              {
                                CalledInAt = DateTime.Parse(tbsite.CalledInAt.ToString(), new CultureInfo("en-GB", false)),
                                RemoteType = tbsite.RemoteType,
                                NoOfRemotes = (tbsite.NoOfRemotes == null) ? 0 : Convert.ToInt32(tbsite.NoOfRemotes),
                                GateType = tbsite.GateType,
                                NoOfRacks = (tbsite.NoOfRacks == null) ? 0 : Convert.ToInt32(tbsite.NoOfRacks),
                              };
  </code></pre>
  
  <p>My Model:</p>
  
  <pre><code>public class Gate
      {
  
          public DateTime CalledInAt { get; set; }
  
          public string RemoteType { get; set; }
          public int NoOfRemotes { get; set; }
          public string GateType { get; set; }
          public int NoOfRacks { get; set; }
          public string ClickToEdit { get; set; }
  
      }
  </code></pre>
  
  <p>I'm getting following errors.</p>
  
  <blockquote>
    <p>"LINQ to Entities does not recognize the method 'System.DateTime
    Parse(System.String, System.IFormatProvider)' method, and this method
    cannot be translated into a store expression."}   System.SystemException
    {System.NotSupportedException}</p>
    
    <p>{"LINQ to Entities does not recognize the method 'Int32
    ToInt32(System.Object)' method, and this method cannot be translated
    into a store expression."}    System.SystemException
    {System.NotSupportedException}</p>
  </blockquote>