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

  • Home
  • SEARCH
  • 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 6118279
In Process

The Archive Base Latest Questions

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

I have a library function that returns a list of domain objects from a

  • 0

I have a library function that returns a list of domain objects from a Linq query.

IList<Apple> getApplesByCriteria( ... );

I bind the DataSource property of a DataGridView to the result of this function. Everything works well. Now I want to manipulate properties of Apple. The presentation domain object (UIApple) is different than the original domain object (Apple), where

UIApple map( Apple apple );

converts one to the other.

If I create an intermediate class – UIApple, what do I need to do to persist editing of the DataGridView back to the database? I learned that adding [Browsable(false)] can hide a collumn. However, I’d prefer not to 1) pollute the domain objects with UI concepts; 2) change the auto generated source code.

  • 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-23T15:25:05+00:00Added an answer on May 23, 2026 at 3:25 pm

    I created UIApple which is backed by Apple and contains all the manipulation code.

    For example:

    class Apple {
        // generated by Visual Studio
        public int Color { ...
    }
    
    class UIApple {
        private Apple _domain;
        public string Color 
        {
             get { if(_domain.Color == 0) return "Black"; }
             set { if(value == "Black") _domain.Color = 0; }
        }
        // hide all unwanted attributes        
    }
    

    To persist at the end of editing,

    UIApple uiApple;
    
    // some editing through UI
    
    // to commit -
    db.SubmitChanges();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that returns a list like this:- List <Column <String1, String2>>
I have a function in an external library that I cannot change with the
I have got a C function in a static library, let's call it A,
I have imported the kernel32 library. So, I have the createMutex function available but
I have a library A, that I develop. When I deploy it on a
I have a library that I would like to license and distribute. I know
We have a database library in C# that we can use like this: DatabaseConnection
So basically I have a big list of buttons that's present dropdowns and other
I have a class that builds a url with query string parameters and so
Alright, I have library I wrote in C that reads a file and provides

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.