An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

Posted by mazhar on Stack Overflow See other posts from Stack Overflow or by mazhar
Published on 2010-05-06T21:20:06Z Indexed on 2010/05/09 1:28 UTC
Read the original article Hit count: 489

Ok the thing is that I am using asp.net mvc with linq to sql. I have a scenario where there are two tables group and features with many to many relationship with the third table groupfeatures. I have drag and drop all three table in the dbml file.

The thing is that it runs fine with group but when I call the Feature things the above error occured and the compilers stops at this line in ((())).

public partial class EgovtDataContext : System.Data.Linq.DataContext
{

    private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

    #region Extensibility Method Definitions
    partial void OnCreated();
    partial void InsertGroup(Group instance);
    partial void UpdateGroup(Group instance);
    partial void DeleteGroup(Group instance);
    partial void InsertFeature(Feature instance);
    partial void UpdateFeature(Feature instance);
    partial void DeleteFeature(Feature instance);
    partial void InsertGroupFeature(GroupFeature instance);
    partial void UpdateGroupFeature(GroupFeature instance);
    partial void DeleteGroupFeature(GroupFeature instance);
    #endregion

    (((public EgovtDataContext() : 
           base(global::System.Configuration.ConfigurationManager.ConnectionStrings["egovtsConnectionString"].ConnectionString, mappingSource))))

The code in both the controller Group and features file is ditto copied. Note the group things are working, the features things are not.

FeaturesRepository.cs

 public IQueryable<Feature> FindAllFeatures()
 {
     return db.Features;
 }

FeaturesController.cs

  FeaturesRepository FeatureRepository = new FeaturesRepository();
  public ActionResult Index()
  {
      var Feature = FeatureRepository.FindAllFeatures();

      return View(Feature);
  }

So what could be wrong?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about linq-to-sql