Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:54:04+00:00 2026-05-25T11:54:04+00:00

I’m starting to use Simple.Data a bit more seriously and have the following scenario

  • 0

I’m starting to use Simple.Data a bit more seriously and have the following scenario that doesn’t seem to be working and I can’t wrap my head around why not (probably something silly as I’ve been staring at it for a few hours).

Basically db structure:

Activity <-> Activity_Join <-> Location

(A many to many relationshop using a join table, an activity and location should be pretty straightforward. Say a paintballing activity could be at both Bristol, Bath and so on. Trip is basically a version’ing thing (male/female/etc) for content/styling.)

Simple.Data query:

return _database.Activity.Query()
.Join(_database.Activity_Join).On(_database.Activity.ID_Activity == _database.Activity_Join.ID_Activity)
.Join(_database.Location).On(_database.Activity_Join.ID_Location == _database.Location.ID_Location)
.Where(_database.Activity.ID_trip == idTrip && 
    _database.Activity.Activity_Time == 'D' && 
    _database.Activity.Is_Public == true)
.Select(
    _database.Activity.ID_Activity
    , _database.Location.ID_Location
    , _database.Activity.ID_Trip
    , _database.Activity.Activity_Name
    , _database.Activity.Adrenaline_Factor
    , _database.Activity.Relaxation_Factor
    , _database.Activity.Fun_Factor
    , _database.Activity.Activity_Description
    , _database.Activity.Activity_Extra_Info
    , _database.Activity.Activity_Time
    , _database.Activity.Activity_Price
    , _database.Activity.Activity_Duration
    , _database.Activity.Activity_Image
    , _database.Activity.Is_Public).Cast<Activity>();

POCO:

using System;

namespace Blah.Models.POCOs
{
    public class Activity
    {
        public Guid ID_Activity { get; set; }
        public Guid ID_Location { get; set; }
        public Guid ID_Trip { get; set; }
        public string Activity_Name { get; set; }
        public int Adrenaline_Factor { get; set; }
        public int Relaxation_Factor { get; set; }
        public int Fun_Factor { get; set; }
        public string Activity_Description { get; set; }
        public string Activity_Extra_Info { get; set; }
        public string Activity_Time { get; set; }
        public decimal Activity_Price { get; set; }
        public string Activity_Duration { get; set; }
        public string Activity_Image { get; set; }
        public bool Is_Public { get; set; }
    }
}

The aim of the query is to fetch the Activity per Trip and tag on the ID_Location guid to be able to figure out where the activity takes place. Further on in my code I hold the list of locations in memory so will use LINQ rather than DB for a few other reasons.

The problem is it won’t cast to the POCO! The error and stack trace is:

Object reference not set to an instance of an object.

   at Simple.Data.Ado.Joiner.<GetJoinClauses>d__a.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
   at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext()
   at System.String.Join(String separator, IEnumerable`1 values)
   at Simple.Data.Ado.QueryBuilder.HandleJoins()
   at Simple.Data.Ado.QueryBuilder.Build(SimpleQuery query, IEnumerable`1& unhandledClauses)
   at Simple.Data.Ado.AdoAdapter.RunQuery(SimpleQuery query, IEnumerable`1& unhandledClauses)
   at Simple.Data.SimpleQuery.Run()
   at Simple.Data.SimpleQuery.Cast[T]()
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at blahh.Models.Site.SitemapGenerator.GetDayActivitiesPerTrip(Guid idTrip) in D:\Projects\blah\blahh\Models\Site\SitemapGenerator.cs:line 39
   at blahh.Models.Site.SitemapGenerator.Generate() in D:\Projects\blah\blahh\Models\Site\SitemapGenerator.cs:line 80
   at blahh.Controllers.AdminController.Generate_Sitemap() in D:\Projects\blah\blahh\Controllers\AdminController.cs:line 1360
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:54:04+00:00Added an answer on May 25, 2026 at 11:54 am

    I just added a test to the Simple.Data suite which does (in join terms) exactly what you’re doing there, and unfortunately (for the purposes of answering your question), it passes.

    Are you using the latest version? I’ve recently pushed 0.9.5 to NuGet, so maybe updating to that will help? Failing that, we could take this over to the Google Group and I’ll help you resolve it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.