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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:23:00+00:00 2026-05-18T07:23:00+00:00

I like the tight coupling between LinqToSql data context objects and the underlying SQL

  • 0

I like the tight coupling between LinqToSql data context objects and the underlying SQL database, however I’m curious how obfuscation fits into the picture.

[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FamilyId", IsPrimaryKey=true, IsDbGenerated=true)]
public int FamilyId
{
  get
  {
    return this._FamilyId;
  }
  set
  {
     if ((this._FamilyId != value))
     {
        this.OnFamilyIdChanging(value);
        this.SendPropertyChanging();
        this._FamilyId = value;
        this.SendPropertyChanged("FamilyId");
        this.OnFamilyIdChanged();
     }
  }
}

In the data context, the property autogenerated setter for my objects in this case hard codes the PropertyName eg. “FamilyId” string in the SendPropertyChanging method call. Changes in this code will be replaced next time the file is regenerated, so I can’t use reflection helpers to get the property names.

Clearly once obfuscation has occured this property will be call something entirely different. This appears to prevent the notification event from reaching WPF applications UI eventhandlers.

So I thought, let’s try wrap those autogenerated data objects up, adapter pattern style. At least the wrappers will be obfuscated. So as per stackoverflow hardcode vs reflection

    private Family _family;

    public int FamilyId
    {
        get { return _family.FamilyId; }
        set
        {
            NotifyPropertyChanging(() => FamilyId);
            _family.FamilyId= value;
            NotifyPropertyChanged(() => FamilyId);
        }
    }

Which seems okay until I try and deal with collections. EntitySet collections are more complex as each element in the collection needs to cast to the wrap type. Additionally complexity starts growing when we start talking lazy loading, transactions and the fact we are not performing the Business Layer Logic on real types but wraps types.

So my gut feel is that this is getting way to complex.

Does anybody else use WPF, LinqToSql data classes and obfuscation that can shed some light on a more correct architecture?

Which obfuscation tool are you using that helps support this process?

Looking back on what you have learnt from your attempts, can you recommend whether you would go throught the same process again? Would you attempt another way.

My preference is of course to have everything obfuscated completely, not stick with half baked wrapping with high overheads if it gives me very little protection.

  • 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-18T07:23:01+00:00Added an answer on May 18, 2026 at 7:23 am

    “My preference is of course to have everything obfuscated completely, not stick with half baked wrapping with high overheads if it gives me very little protection.”

    Are you sure you need obfuscation in this area of your solution? What are you actually trying ‘to protect’?

    In my experience, the benefit comes from obfuscating custom UI code and business logic classes. (that a competitor could possibly copy and leverage).

    There isn’t a great deal of benefit in obfuscating auto-generated service code. You don’t really have much IP there to protect…

    The tool you are using should allow you to define which classes you want to obfuscate and which ones you don’t. I wouldn’t describe this approach as ‘half baked’

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

Sidebar

Related Questions

Consider something like figure plot(sin(0:0.01:pi)) axis tight set(gca,'box','on','ticklength',[0.02 0.05]) then export the graph to
Like many others on this site I am considering a move to ASP.NET MVC
Like the Delicious submission bookmark-let, I'd like to have some standard JavaScript I can
Like it says.
Like many of you, I use ReSharper to speed up the development process. When
Like many companies that require all access be through stored procedures, we seem to
Like the title says Where and How (i.e. if encrypted, with what method) does
Like most *nix people, I tend to play with my tools and get them
Like the title says, how do you create custom code snippets in Visual Studio
Like the title says, If I place an app_offline.htm in the application root, will

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.