Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12532

.NET: Recognize fields with KeyAttribute and set QueryField.IsKeyField

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • platforms
    • Docs Required, Release Notes Required

    Description

      Populate QueryField.IsKeyField automatically when System.ComponentModel.DataAnnotations.KeyAttribute is present. See QueryEntity.ScanAttributes.

      This:

      class Person
      {
          [QuerySqlField]
          [Key]
          public string EntityId {get; set;}
      }
      
      ...
      new QueryEntity(typeof(string), typeof(Person))
      

      Should be equivalent to this:

              <queryEntity keyType="System.String" ...>
                <fields>
                  <queryField fieldType="System.String" name="EntityId" isKeyField="true" />
                </fields>
              </queryEntity>
      

      Attachments

        Activity

          People

            ptupitsyn Pavel Tupitsyn
            ptupitsyn Pavel Tupitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: