title: Linq to SQL with medium trust level
body: <p>I used Linq to SQL in an ASP.NET app that I now need to deploy on a server. Unfortunately, the hosting sever can only offer a medium level trust. My app crashes not having permission of type ReflectionPermission.</p>
  
  <p>Is there a way to edit my queries to work around this restriction?</p>
  
  <p>For example, my app crashes when calling this code:</p>
  
  <pre><code>Error error = new Error { Date = DateTime.Now, Message = message, StackTrace = stack };
  dataContext.Errors.InsertOnSubmit(error);
  dataContext.SubmitChanges();
  </code></pre>
  
  <p>Thanks.</p>