Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Garðar Þorsteinsson 98 posts 473 karma points
    Mar 20, 2014 @ 16:59
    Garðar Þorsteinsson
    1

    Code first create Nvarchar(Max)

    Hi all,

    I have been scratching my head all day on how to make Umbraco create a custom table from model on Application start.

    I got all the functions working but I cant seem to make it create a Nvarchar(Max) column.

    This is my Model column :

            [Column("values")]

            [NullSetting]

            [MaxLength]

            public string values { get; set; }

     

    I know the MaxLength is more of an EF attribute and should not work, I found in the Umbraco core all the data attributes available and the only attribute that could change the length of the string is [Length(4000)] but I cant do [Length] to get Max. 

    Any ideas how this is done ?

    Link to all the attributes:

    https://github.com/umbraco/Umbraco-CMS/tree/7.1.0/src/Umbraco.Core/Persistence/DatabaseAnnotations

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies