CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Inherited managed properties bug?

Last post 09-09-2008, 1:37 PM by jureleskovec. 2 replies.
Sort Posts: Previous Next
  •  09-06-2008, 8:40 AM 25993

    Inherited managed properties bug?

    Many of my BOs derive from the base BO class BusinessBaseWithId<T>. As the name of the class implies, it has one managed property 'Id' of type 'int'. Let's say I have BO named 'Project' which extends the BusinessBaseWithId<T> and has one managed property named 'Name'.

    When using local proxy everything is OK. FieldManager of the returned 'Project' object shows 2 PropertyInfo objects in the '_propertyList' collection (Name and Id).
    But when switching to the WcfProxy there is only one item in the property list collection (Name), the Id property info is missing.

    I know the problem with static fields that need to be initialized before using BO. I already have the following code in the base class:

    private static int _dummy;
    protected BusinessBaseWithId()
    {
          _dummy = 0;
    }

    In fact I can't belive I ran on a bug that is so easy to find. I still belive I'm just missing something.


    -- Jure
  •  09-06-2008, 8:48 PM 25998 in reply to 25993

    Re: Inherited managed properties bug?

    Set the dummy flag within OnDeserialized as well.

     

  •  09-09-2008, 1:37 PM 26049 in reply to 25998

    Re: Inherited managed properties bug?

    That did it, thanks man!

    -- Jure
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems