none
StoreGeneratedPattern = Computed RRS feed

  • Question

  • Hi,

    on edmx schema I can select Computed for StoreGeneratedPattern property.

    But it does not have formula property.

    The problem is when I use data base generater for create script for SQL

    is generate 

    [SubTotal] decimal(9,2) NULL,

    and I need that

    [SubTotal]  AS ([dbo].[fctSubTotalOrder]([Id])),

    What you recommanded for my that ?

    Can I add manualy property on EdmProperty ?

    If yes. I can edit SSDLToSQL10.tt 

    -- Creating table '<#=tableName#>'

    CREATE TABLE <# if (!IsSQLCE) {#>[<#=schemaName#>].<#}#>[<#=tableName#>] (
    <#
            for (int p = 0; p < entitySet.ElementType.Properties.Count; p++)
            {
                EdmProperty prop = entitySet.ElementType.Properties[p];
    #>
        [<#=Id(prop.Name)#>] <#=prop.ToStoreType()#> <#=WriteIdentity(prop, targetVersion)#> <#=WriteNullable(prop.Nullable)#><#=(p < entitySet.ElementType.Properties.Count - 1) ? "," : ""#>
    <#
            }
    #>

    Thursday, December 8, 2016 10:04 PM

All replies

  • Hi Francois,

    You could edit the SSDLToSQL10.tt file using your preferred convention, I suggest that you could backup the file before you edit it.  the new file will show up in the "DDL Generation Template" drop down in Visual Studio.

    For more information, please refer to:

    http://stackoverflow.com/questions/2970225/when-i-generate-the-ddl-from-an-entity-framework-4-0-model-can-i-change-how-it-n

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 9, 2016 9:40 AM
    Moderator
  • Hi Cole,

    Do you know if I can ADD a custom property on EDMProperty ?

    If I edit SSDLToSQL10.tt I need my formula to adding on the code.


    Friday, December 9, 2016 12:00 PM
  • Hi Francois,

    As far as I know, we could not add the a custom property on EDMProperty UI.

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 13, 2016 2:38 AM
    Moderator