none
Generate an AssociationAttribute from a given NavigationProperty at generation-time?

Answers

All replies

  • Hi Shimmy,

    Welcome!

    I think you can use Reflector to get Attributes

    Entitye.GetType().GetProperty("NavigationName").GetCustomAttributes(false)

    I'm not sure what you are really need, If this couldn't achieve your goals, would you please feel free to let me know.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 25, 2011 7:51 AM
    Moderator
  • Hi Alan and thanks for your response!

    The could will be used at generation time, using reflection is not a good option, and will probably not even give the results.

    I think the answer I'm looking for is an explanation on how to use the AssociationAttribute, and what arguments to pass to its constructor, on the various relation ship types (one2many/one2one/many2many scenarios).


    Shimmy
    Wednesday, May 25, 2011 8:17 AM
  • Hi Shimmy,

    Thanks for your feedback!

    AssociationAttribute means that in one of the objects participating in the relationship, there must be a property which holds the primary key of the related object. Direct many to many relationships are because of this currently not supported.

    I quote the content from here: http://blogs.infosupport.com/blogs/alexb/archive/2011/01/27/a-guide-through-wcf-ria-services-attributes.aspx

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 25, 2011 8:40 AM
    Moderator
  • Hi Shimmy,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 31, 2011 6:48 AM
    Moderator
  • The link you sent me helped me a lot.


    Shimmy
    Thursday, June 02, 2011 10:28 PM