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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:56:24+00:00 2026-06-17T18:56:24+00:00

We are migrating our SProc based solution over to ORMLite, and so far has

  • 0

We are migrating our SProc based solution over to ORMLite, and so far has been pretty painless. Today I wrote the following method:

    public AppUser GetAppUserByUserID(int app_user_id)
    {
        var dbFactory = new OrmLiteConnectionFactory(this.ConnectionString, SqlServerOrmLiteDialectProvider.Instance);
        AppUser item = null;

        var rh = new RedisHelper();
        var id=  CacheIDHelper.GetAppUserID( app_user_id );
        item = rh.Get<AppUser>(id);

        if (item == null)
        {
            try
            {
                using (var db = dbFactory.OpenDbConnection())
                {
                    item = db.Single<AppUser>("application_user_id={0}", app_user_id);

                    rh.Set<AppUser>(item, id);
                }
            }
            catch (Exception ex)
            {
                APLog.error(ex, "Error retrieving user!");
            }
        }
        return item;
    }

I have remove some of the extraneous fields, but they are basically:

[Alias("application_user")]
public class AppUser : APBaseObject
{

    [Alias("application_user_id")]
    [AutoIncrement]
    public int? UserID
    {
        get;
        set;
    }

    [Alias("application_user_guid")]
    public string UserGUID
    {
        get;
        set;
    }

 //MORE FIELDS here.

}

The challenge is that they only field that is populate is the ID field, AND I already know that ID because I am passing it into the method.

I did get the last SQL called and ran that against the DB directly and all of the fields were being referenced correctly.

I stepped through the code in the debugger, and everything came back correctly, except that the only field returned was the ID.

Thoughts?

  • 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-17T18:56:25+00:00Added an answer on June 17, 2026 at 6:56 pm

    I had a similar issue which was caused by my class methods not mapping to the db properly. My exact issue was caused by a nullable int field in the db and the class method was defined as an ‘int‘ instead of ‘int?‘.

    Perhaps you have a similar issue?

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

Sidebar

Related Questions

We're migrating our legacy system based Visual FoxPro to Java, and we need to
We are migrating our builds over to gradle and I used to have an
I have been working on migrating our code base onto Glassfish 3.1.2 using Java
I have been tasked with migrating our product's UI to VS2010. It is an
We are migrating to a Sharepoint solution and our urls are changing slightly. Are
I am currently in the process of migrating our software solution from Delphi 7
We are migrating to Richfaces 3.3 to Richfaces 4.2 and getting following error. Our
We're finally migrating our unit test code base from JUnit 3 to JUnit 4.
We're migrating our dev shop away from XCode to MonoTouch. In Objective-C, the [super]
I am migrating our hosting environment to a totally new data center with new

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.