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 477821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:37:46+00:00 2026-05-13T00:37:46+00:00

I’m new to PLINQO, I’m fairly new to LINQ2SQL and I’m adding a new

  • 0

I’m new to PLINQO, I’m fairly new to LINQ2SQL and I’m adding a new DAL (called DAL2) in parallel with our old existing DAL. Our idea is to start using linq2sql for every new thing we add and slowly start moving old DAL usage to the new DAL2.

As we all know, DLINQ is nice for simple things but in more complicated scenarios (many2many, deattached objects, etc.) issues arise instantly and new need to hack around it. PLINQO (together with CodeSmish) comes to the rescue and adds all the necessary structure and tools to make it more usable. So far, so good.

Now I already have my DAL2 (I’m using Managers). It “works”. But I have a few doubts.

I understand that returning an object composed of the following query:

select name,  Count(*) as Total from SomeTable 

…is not a weird scenario in most DB applications. The query is a simple example of what would be a nice anonymous type.

Now for a second, imagine a table structure like this.

Tag (1) <—> (n) PatientTag (n) <—> (1) Patient

The idea is to know how many patients each tag has. A simple inner join would fix this with SQL, between tag and patient tag. I don’t even need access to Patient table for that. (I just need the count).

After all, all I want is for example:

TAG1, 33

TAG2, 21

TAG3, 6

etc…

Suppose I manage to create a linq2sql query that does it:

   var result1 = from pt in dc.PatientTag
                 join t in dc.Tag on pt.TagId equals t.TagId
                 select new { TagName = t.TagName };


   var result2 = from q in result1
                 group q by q.TagName into gp
                 select new { TagName = gp.Key, Total = gp.Count() };

(I’m new to LINQ so if the above is not good, forgive my lack of “LINQissm”)

Given that I cannot return that “new” anonymous type (unless I go for Object and reflection which is not my intention), I assume I have to create a “helper” class to contain the two things (name and total). The idea is that the above code should sit somewhere in the datalayer or the business layer, and not in the UI’s code.

Now the real question:

If the above is true, where should I create that “helper” if I want to return that result (or array of results) to a UI (for proper displaying and handling)?

1) In DAL2/Helper/TagNameTotal.cs (to put an example)

2) In a BLayer/Helpers/TagNameTotals.cs?

3) None of the above? (or either?)

If the above is not true, what am I incorrectly thinking?

Isn’t it normal when someone wants to pass the result of a query to the UI and modify it? Say in the above example I’d like to change TagName in the UI (maybe that’s not the best example but it applies).

Excuse me but I still find the whole LINQ2SQL to be a little bit crude when it’s used outside a webproject or a simple app. These are basic things we’ve been doing with ADO.NET (and recordsets before that) forever.

Make a select/join/group/crazySQL, modify, commit the changes back.

PLINQO is nice because it takes away the hassle of LINQ2SQL in its crude form (many 2 many, deatached, context regeneration, cache, etc.), but it’s still LINQ, so DLINQ practices must apply.

What am I missing?

note: Do not confuse PLinq with PLinqO.

  • 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-13T00:37:46+00:00Added an answer on May 13, 2026 at 12:37 am

    I have answered this post in the codesmith community, however I was thinking about this and came across this post. You may find this post some help

    Basically you create a mini class and use the let statement to define a sub set then lazy load it when you need it….

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

Sidebar

Related Questions

New to javascript/jquery and having a hard time with using this or $(this) to
I have been going over the practicality of some of the new parallel features
New to REgEX and in my sixties so bear with me Using ColdFusion so
I am fairly new to Plinq and Repo pattern. I nee some references and
New to Objective-C, Cocoa, and compiled languages in general so forgive my ignorance: UIImage
New to node. Can somebody help me understand how to use/configure r.js with coffeescript
New to Rails, and following a tutorial that starts by creating the classic blog
New to Chrome programming, but am more or less familiar with Javascript. Goal: A
New to Mongo, taking on the analytics quest and have a schema question. I'm
New to this, so bear with me if I missed this somewhere in another

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.