1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / SF5: OpenAccess.Metadata.Fluent.StringPropertyConfiguration' does not contain a definition for 'IsLongText'?

SF5: OpenAccess.Metadata.Fluent.StringPropertyConfiguration' does not contain a definition for 'IsLongText'?

3 posts, 0 answered
  1. SteveV
    SteveV avatar
    178 posts
    Registered:
    06 Nov 2011
    23 Aug 2012
    Link to this post
    I'm running SF5 and have a custom module which includes a string field whose length is greater than 255 characters.  In my fluent mapping I'm trying to do the following:

    curriculumDbDoc.HasProperty(d => d.Description).IsLongText(this.Context).IsNotNullable();

    However, Intellisense is not showing the IsLongText as a member method and I get the following compiler error:

    'Telerik.OpenAccess.Metadata.Fluent.StringPropertyConfiguration' does not contain a definition for 'IsLongText' and no extension method 'IsLongText' accepting a first argument of type 'Telerik.OpenAccess.Metadata.Fluent.StringPropertyConfiguration' could be found (are you missing a using directive or an assembly reference?) C:\Program Files (x86)\Telerik\Sitefinity 4.3\Projects\NLG Sitefinity Site\NLG Sitefinity Site\Modules\CurriculumDbDoc\Data\CurriculumDbDocFluentMetaDataSource.cs

    What am I missing?

    --Steve

  2. SteveV
    SteveV avatar
    178 posts
    Registered:
    06 Nov 2011
    25 Aug 2012
    Link to this post
    Can I assume that the IsLongText method was replaced with the HasColumnType("varchar(max)") method:
    curriculumDbDoc.HasProperty(d => d.Description).HasColumnType("varchar(max)");

    Again, gotta say the documentation needs a lot of work.  Searching the full docs for "IsLongText: produces 0 results.  Searching for "HasColumnType" returns 1 result: "How to create a Testimonials Intra-site module - Creating the fluent mappings" which includes some code where HasColumnType("varchar(max)") method is used but makes no mention of its usage, permitted values, etc.  Frankly, I expect more for a product in this price range.

    --Steve
  3. PetarP
    PetarP avatar
    1 posts
    Registered:
    05 Apr 2017
    28 Aug 2012
    Link to this post
    Hello SteveV,

     The IsLongText method is still there but please note that this is an extension method provided by sitefinity and not OpenAccess. As such you will need to include the Telerik.Sitefinity.Model namespace in order to use it without compilation errors.
    The HasColumnType method comes from the OpenAccess API and is used to explicitly specify the type to which your column will be mapped. Basically both methods should result in the same behaviour.

    Regards,
    Petar
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
3 posts, 0 answered