This project is read-only.

adding properties to partial class

Mar 18, 2011 at 9:39 PM
Edited Mar 18, 2011 at 10:48 PM

In the partial class of a generated object called  ''file'' i added the following property : 

partial class File
    {         private System.Drawing.Image m_Image;
              public System.Drawing.Image Image
         {
             get
             {
                 return m_Image;
             }
             set
             {
                 m_Image = value;
             }
         }
     }

then in code i use the following code  in the client  to iterate all the items in the collection and append an image to each file object  (in vb):

  For Each fl As Company.Models.Objects.File In  FilesListCollection
       -- append image to image property  

                fl.Image =--function that returns an image

   Next fl

The strange thing is that the image shows up when examining the fl.Image property but when i examine the property in the context of the collection it returns back nothing ( FilesListCollection(0).Image --This returns nothing ).

Is this by design or am i missing something ?

Giannis

 

 

 

 

 

 

Mar 19, 2011 at 1:31 AM

No this is not by design. On first thought you must be re-querying the object or somehow reloading it. However I would need to see the code you are using to set and then loop. First please put a breakpoint on the constructor of the object and also a breakpoint on the setter of the Image property to verify that it is not be reset somewhere. If you set that property there is no reason for it to be null unless it was reset that way. If you have a sample project that recreates this issue please send it to feedback@nhydrate,.org. I think you should try the breakpoints first as I think you must to setting the property to null or the a new object is being created and you do not know about it.

Mar 25, 2011 at 6:14 PM

Please let me know if you have any more information on this issue.

Apr 4, 2011 at 6:30 PM

i am still having the same issue with partial class properties , although i have the latest release. 

I have sent a test project to  feedback@nhydrate.org showing the problem.

Thanks

Giannis