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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:09:18+00:00 2026-05-11T17:09:18+00:00

For background, I have a Data layer and Service layer loosely based on Rob

  • 0

For background, I have a Data layer and Service layer loosely based on Rob Conery’s Storefront model and like Rob’s, many of my domain objects and chained with LazyList<>‘s and LazyItem<>‘s to make use of the deferred execution that Linq2Sql provides given that my Lazy* types utilise IQueryable<T> rather than this awesome delegate approach.

So I have an object graph like this (basically, each Activity should have a photo gallery of many images- thumbnails and full size photos):

latest3Activities[0].Gallery.Images.Inner[1].FullImage

The Gallery type has an Images property of LazyList<PhotoGalleryImage> and so the IList<PhotoGalleryImage> from that LazyList is the Inner you see. Each PhotoGalleryImage item has a FullImage property and a Thumbnail property, both of type Image.

The idea is that the full rez uploaded photo is stored in the PhotoGalleryImage.FullImage property and initially, the Thumbnail property is Null.

What I’m after is this: when the Thumbnail property is accessed for the 1st time, if it is Null I want my Service layer to generate the Thumb, persist it to the DB, then return the Image instance which is the smaller photo. I have all the code to create the thumbnail from the full size image, so that’s not the question here.

What I can’t figure out is how to catch the first access of the Thumbnail property (in my IQueryable<> architecture context) and then have the Service layer do the resizing and not the Repositories (DAL). I strongly feel that the Service (business) layer should be responsible for this functionality decision but I don’t see how to make it work.

Currently I’m thinking the mapping from my domain classes in the repositories to the Linq2Sql classes would be a good place to identify this ‘first access’ I refer to, but I don’t then see how a lower tier can then call up into the Service layer and perform the shrink (or even if it can, that it should).

Maybe my design constrains me to have the Repos do the conversion. Maybe I shouldn’t want the Service layer to perform this logic at all. Maybe my design is just so horrid that I really shouldn’t be facing this mess at all. What approach can I use?

  • 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-11T17:09:18+00:00Added an answer on May 11, 2026 at 5:09 pm

    The point of lazy init is to defer allocating resources since you don’t know when or if you need them.

    In your case, this doesn’t really make sense: As soon as the image is uploaded, the server will need the thumbnail — the user wants to see the new image immediately, right? Therefore deferring the creation of the thumbnail has no positive ROI.

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

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't I'm afraid. VS2005 only works with .NET framework… May 11, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer Some ideas that could help : check potential differences of… May 11, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer Basically no. You could attempt to do it by writing… May 11, 2026 at 11:48 pm

Related Questions

I've run across an interesting PHP/SOAP error that has me stymied. After searching I
Newbie to .NET data apps here, coming from a Visual Foxpro background. I'm planning
I have a somewhat complicated assortment of tables for which I need to do
Preamble I'm asking this question because even though I've read through a lot of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.