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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:11:18+00:00 2026-06-07T14:11:18+00:00

Model public partial class SayacOkumalariIstatistik { public string sno { get; set; } public

  • 0

Model

public partial class SayacOkumalariIstatistik
{
    public string sno { get; set; }
    public Nullable<System.DateTime> okuma_tarihi { get; set; }
    public Nullable<decimal> TotalUsageValue { get; set; }
    public string UsageType { get; set; }
}

function

public IList<SayacOkumalariIstatistik> SayacOkumalariGetir()
{
    #region linq concat
    IEnumerable<SayacOkumalariIstatistik> sayac_okumalari_istatistik = entity.TblSayacOkumalari
        .Select(x => new SayacOkumalariIstatistik
        {
            sno = x.sno.ToString() + "T1",
            okuma_tarihi = x.okuma_tarihi,
            TotalUsageValue = x.toplam_kullanim_T1,
            UsageType = "T1"
        })
        .Concat(entity.TblSayacOkumalari.Select(x => new SayacOkumalariIstatistik
         {
             sno = x.sno.ToString() + "T2",
             okuma_tarihi = x.okuma_tarihi,
             TotalUsageValue = x.toplam_kullanim_T2,
             UsageType = "T2"
         }))
         .Concat(entity.TblSayacOkumalari.Select(x => new SayacOkumalariIstatistik
         {
              sno = x.sno.ToString() + "T3",
              okuma_tarihi = x.okuma_tarihi,
              TotalUsageValue = x.toplam_kullanim_T3,
              UsageType = "T3"
         }));
        #endregion

        // Error occurs in here
        return sayac_okumalari_istatistik.ToList();
    }

And Error message is my question title. Why this error occur.

Thanks.

  • 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-06-07T14:11:20+00:00Added an answer on June 7, 2026 at 2:11 pm

    The error message is self-explanatory. You can’t and shouldn’t use your entity classes as projection DTOs (I’m guessing SayacOkumalariIstatistik is such a class)

    You have at least 3 alternatives:

    1. Retrieve the original entities first, then do the projections using Linq to objects (i.e. after the ToList call).
    2. Create a DTO class (SayacOkumalariIstatistikViewModel, SayacOkumalariIstatistikDTO, whatever) and use that in your query.
    3. Use anonymous objects for the projection.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My model: public class Father { Set<Son> sons = new HashSet<Son>(); String name =
Here's my model: public class StockRequestModel { public int StockID { get; set; }
I have the following Model: public class DeliveryTracking { public string TrackingRef { get;
I have the following model: public class Tag { public int Id { get;
I have a model with complex properties like: public partial class CrmDefinedEntity { private
I have a partial class in a dbml file. public partial class Comment string
For example I have two entities Class A { public Guid Id {get;set;} public
model public partial class TblMusteriler { public TblMusteriler() { this.TblSayaclar = new HashSet<TblSayaclar>(); }
I have the following model: public class Contact { public Contact() { Name =
Here is my model: public class RestoreRequestModel : IDataErrorInfo { //true seems Value contains

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.