Douglas Purdy

“M”: Attributes/Annotations

with 2 comments

AAguiar asked me a question related to my EDM 3.0: Bring EDM and “M” together post that I wanted to answer here.

@douglasp In .edmx I could add attributes in my own namespace to enrich my model. How is that going to work with ‘M’?

In the latest CTP you can add attributes/annotations for “M” types, extents, fields, functions.

Below is a simple example.  Note the SQL that is generated by default, but you can control that as well.

attributes

December 4th, 2009 at 8:15 pm

Posted in Oslo, SQL Server Modeling, Software Development

2 Responses to '“M”: Attributes/Annotations'

Subscribe to comments with RSS or TrackBack to '“M”: Attributes/Annotations'.

  1. hi doug,

    this…

    ##Docs {description => “foo type”}
    type foo
    {
    id :Integer32;
    }

    ##Docs {description => “bar type”}
    type bar
    {
    id :Integer32;
    }

    gives me…

    empty 0,0 Error M2034 The entity field ‘About’ requires a membership constraint (’in’ or ‘<=’).

    am i missing something?

    cheers

    tim

    18 Dec 09 at 05:28

  2. yes. you need to put an identity on the type. that is how we wire-up the attribute to the type or extent def.

    ##Docs {description => “bar type”}
    type bar
    {
    id :Integer32;
    } where identity id

    douglasp

    18 Dec 09 at 18:52

Leave a Reply