1

It is such that I must have sent some content from my controller over to Angularjs which shall come forth with words such as only L in themselves or E, so it goes in other words, of words where it like just let the words sign which has the single letter.

There is no fault forward by the console and what I believe is the problem is that it does not specify any value to the side.

i have try its here:

A circular reference was detected while serializing an object of type 'SubSonic.Schema .DatabaseColumn'.

Load.js

var app = angular.module('WordSpreads',[]);
app.controller('WordSpreadsListValue', function ($scope, $http) {
    $http(
        {
            method: 'GET',
            url: '../Profile/MWordSpreads'
        }).success(function (response) {
        $scope.entries = data.List;;
        });
    console.log("TEST");//It does not appear in the console log.
});

Controller:

    [HttpGet]
    public JsonResult MWordSpreads()
    {
        WordsSpreadsListValue model = new WordsSpreadsListValue();

        var db = HelperToTables.DbValue;
        model.List = db.WordSpreads.ToList();

        return Json(model.List, JsonRequestBehavior.AllowGet);
    }

Model:

public class WordsSpreadsListValue
{
    public List<WordSpread> List { get; set; }
}

Error giv me:

A circular reference was detected while serializing an object of type 'xxSitename.Models.LinqDatabase.WordSpread'

UPDATE:

model.List = db.WordSpreads.Select(x => new {
            Name = x.name,
            TextValue = x.text.ToString()
        }).ToList();

ERROR :

Cannot implicitly convert type 'System.Collections.Generic.List<>' to 'System.Collections.Generic.List' MVCOrdklar2015

.

Community
  • 1
  • 1

1 Answers1

0
model.List = db.WordSpreads.Select(x => new { Prop1 = x.1, Prop2 = x.2}).ToList();

You are having trouble serializing model.List, the Json serialize is barfing on serializing model.List. If you make it a new object without navigation properties you will be fine.

In my experience it has to do with the navigation properties, I dont fully understand what it is. But, once you remove the navigation properties from the equation it will work.

gh9
  • 10,169
  • 10
  • 63
  • 96