none
Adding comments for paramters of FunctionImport

    Domanda

  • I've not found 'Documentation' property for  Functions (Function Imports) and for complex types in EF visual designer, so I've decided to add these comments using XML editor directly in edmx file, something like here:

    <FunctionImport Name="DeleteDistributor">
                <Documentation>
                  <Summary>Removes distributor from database</Summary>
                </Documentation>
                <Parameter Name="DistributorID" Mode="In" Type="Int32" >
                  <Documentation>
                    <Summary>Distributor identifier</Summary>
                  </Documentation>
                </Parameter>
              </FunctionImport>

    But when I change something using EF visual designer, all descriptions of parameters is removing.  So, quesion is - how can I add comments (descriptions)  for parameters, complex types and another EF items and how push EF to keep it during manipulation with entities?

    Thank you.

    venerdì 2 marzo 2012 16:01

Tutte le risposte

  • Hi winsky,

    You can try @Michael's suggestion here: http://social.msdn.microsoft.com/Forums/is/adodotnetentityframework/thread/7f16c10a-06c5-433a-bcb5-5f214099f53c 

    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.

    lunedì 5 marzo 2012 07:14
    Moderatore
  • Hi, Alan

    I don't generate database from my EF file, so I don't need any comments in T-SQL script. All I need  - to add comments to all generated c# code by entity framework. I don't want see following comments in my code ('No Metadata Documentation available.'), we use these comments to documentation generation.

    /// <summary>
            /// No Metadata Documentation available.
            /// </summary>
            /// <param name="distributorName">No Metadata Documentation available.</param>
            /// <param name="distributorCode">No Metadata Documentation available.</param>
            /// <param name="regionID">No Metadata Documentation available.</param>
            /// <param name="distributorID">No Metadata Documentation available.</param>
            /// <param name="salesDataUploaderVersion">No Metadata Documentation available.</param>
            /// <param name="active">No Metadata Documentation available.</param>
            public ObjectResult<Distributor> GetDistributors(global::System.String distributorName, global::System.String distributorCode, Nullable<global::System.Int32> regionID, Nullable<global::System.Int32> distributorID, global::System.String salesDataUploaderVersion, Nullable<global::System.Boolean> active)
            {
    }

    Part of items (Entities, entity properties) support documentation, but another part - doesn't support. Do you propose add these comments manually in directly into XML? I did, but as I said part of added comments are being removed if I change something in EF visual designer. 

    lunedì 5 marzo 2012 08:19
  • any suggestions?
    mercoledì 7 marzo 2012 09:47