locked
Entity framework acces by reference RRS feed

  • Question

  • User-1982615125 posted

    how to reference to properties of entitiy framework models?

    ReferenceTest(EntityModel.Adress)

    sub ReferenceTest(t as property)

    msgbox(t)

    end sub

    Sunday, January 21, 2018 5:55 PM

All replies

  • User1400794712 posted

    Hi fazioliamboina,

    If you want to use 'Adress' property of EntityModel, please create a instance of this model. Not only for Entity Framework, but also for all class.

    VB code:

    Private em As EntityModel = New EntityModel() //If you don't set value to em, em.Adress will be null.
    ReferenceTest(em.Adress)

    C# code:

    EntityModel em=new EntityModel(); //If you don't set value to em, em.Adress will be null.
    ReferenceTest(em.Adress);
    

    Best Regards,

    Daisy

    Monday, January 22, 2018 2:05 AM
  • User-1982615125 posted

    i know that..

    but i mean.. i want to pass the reference to the object. not the object instance at that time.

    i want an usercontrol to be in charge of datamanipulation for that specific property, and have read and write acces of its own.

    Monday, January 22, 2018 2:34 PM
  • User1400794712 posted

    Hi fazioliamboina,

    i want to pass the reference to the object. not the object instance at that time.

    i want an usercontrol to be in charge of datamanipulation for that specific property, and have read and write acces of its own.

    Could you please explain your idea in detail? I'm not clear about your need, can you give me an example? Then I can understand it better.

    Best Regards,

    Daisy

    Wednesday, January 24, 2018 9:44 AM