Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are your entities marked with a <code>DataContract</code> attribute? Are you making sure that they are serializable?</p> <p><strong>EDIT:</strong> By looking at your code it seems that you are using your entities directly. This is not a good practice because (even if your code was working) I don't think you want extra properties like the ones that Entity Framework auto-generates.</p> <p>In these case you should consider to use DTOs (Data Transfer Objects), this is an example of how <code>Newspaper</code> class could be:</p> <pre><code>[DataContract] public class NewspaperDTO { public NewspaperDTO(Newspaper newspaper) { this.Name = newspaper.Name; this.Image = newspaper.Image; this.Link = newspaper.Link; this.Encoding = newspaper.Encoding; } [DataMember] public string Name { get; set; } [DataMember] public string Image { get; set; } [DataMember] public string Link { get; set; } [DataMember] public string Encoding { get; set; } } </code></pre> <p>And then in your service:</p> <pre><code>public List&lt;NewspaperDTO&gt; GetNews() { return entities.Newspapers.Select(a =&gt; new NewspaperDTO(a)).ToList(); } </code></pre> <p>P. S. I have noticed that your entities are not disposed (inside the WCF service I mean). You should consider using a pattern like this in every method of your service:</p> <pre><code>public List&lt;NewspaperDTO&gt; GetNews() { using (var entities = new MyEntities()) { return entities.Newspapers.Select(a =&gt; new NewspaperDTO(a)).ToList(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload