ObjectConstructed is not getting fired

6 posts, 0 answers
  1. Dilshod
    Dilshod avatar
    23 posts
    Member since:
    Feb 2012

    Posted 02 Jun Link to this post

    Hi,

    I am trying to load some entities from the database and in some cases ObjectConstructed is not getting fired. Here is what I have tried:

    I have Table Person and Stuff. Stuff references to Person (one to many. )

    <p>TelerikContext context = new TelerikContext();<br></p><p>context.Events.ObjectConstructed += (s, e) =>{ //my logic };</p><p>//Use case 1:</p><p>var people = context.People.ToList(); //in this case ObjectConstructed gets fired [people.Count] amount of times</p><p></p><p>//Use case 2:</p><p>var people = context.Stuff.Select(s=>s.Person).ToList(); // in this case I might have 5 person on my collection, but ObjectConstructed never gets fired. </p>

    I want ObjectConstructed to be fired every time i load an object from DB so that I can do my logic accordingly. Can you please instruct me how to acheive that?

     

    Thank you!

  2. Dilshod
    Dilshod avatar
    23 posts
    Member since:
    Feb 2012

    Posted 02 Jun in reply to Dilshod Link to this post

    I couldn't edit my questions. Here I am reposting the use case.

     

    TelerikContext context = new TelerikContext();

    context.Events.ObjectConstructed += (s, e) =>{ //my logic };

    //Use case 1:

    var people = context.People.ToList(); //in this case ObjectConstructed gets fired [people.Count] amount of times

    //Use case 2:

    var people = context.Stuff.Select(s=>s.Person).ToList(); // in this case I might have 5 person on my collection, but ObjectConstructed never gets fired

  3. DevCraft banner
  4. Dilshod
    Dilshod avatar
    23 posts
    Member since:
    Feb 2012

    Posted 14 Jun Link to this post

    Hi,

    Is there any progress on the issue above? I am waiting for the response. I need to take actions according to the answer.

     

    Thanks,

    Dilshod

  5. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 17 Jun Link to this post

    Hello Dilshod,

    Such an issue was never reported and I was not able to reproduce the issue. I prepared a sample application to demonstrate that it is working correctly. You could find the sample attached.

    I hope that helps.

    Regards,
    Boris Georgiev
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
  6. Dilshod
    Dilshod avatar
    23 posts
    Member since:
    Feb 2012

    Posted 08 Jul in reply to Boris Georgiev Link to this post

    Hello Boris,

    Finally I was able to reproduce the issue. To be able to reproduce the issue, please replace the: [xxxxx].IsIdentity(KeyGenerator.Autoinc) with [xxxxx].IsIdentity(). If you do that, object constructed doesn't get fired when you load the entity through select.

     

    Thanks,

    Dilshod

  7. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 13 Jul Link to this post

    Hello Dilshod,

    Thank you for the guidance how to reproduce the issue. After a long research we found out that this is a bug in Telerik DataAccess. Unfortunately I can not give you a time frame if we will fix the issue, when you can expect it.

    Find your Telerik Points updated for the new bug you have helped us identify.
     
    Regards,
    Boris Georgiev
    Telerik by Progress
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top
DevCraft banner