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

Forums / General Discussions / Sitefinity OpenAccess Fail. Can't recognized MapType() or HasProperty()

Sitefinity OpenAccess Fail. Can't recognized MapType() or HasProperty()

2 posts, 0 answered
  1. Preetham Reddy
    Preetham Reddy avatar
    57 posts
    Registered:
    16 Jul 2012
    29 Dec 2010
    Link to this post
    Hi,

    I am trying to create a new table in the Sitefinity Database and trying to use the OpenAccess Fluent API for it, but it doesn't let me. I am following the example exactly the way it's prescribed in OpenAccess Documentation but it still doesn't work.

    What am i doing wrong?

    using System.Web;
    using System.Linq;
    using System.Collections.Generic;
    using Telerik.OpenAccess;
    using Telerik.OpenAccess.Metadata.Fluent;
      
    namespace SitefinityWebApp.Membership
    {
        public class SdnUserProfile
        {
            public int Id
            {
                get;
                set;
            }
      
            public string DateofBirth
            {
                get;
                set;
            }
      
            public bool CountryofCitizenShip
            {
                get;
                set;
            }
        }
        public class MyFluentMetadataSource : FluentMetadataSource
        {
            protected override IList<MappingConfiguration> PrepareMapping()
            {
                IList<MappingConfiguration> preparedConfigurations = new List<MappingConfiguration>();
      
                MappingConfiguration<SdnUserProfile> profileConfiguration = new MappingConfiguration<SdnUserProfile>();
                profileConfiguration.MapType().ToTable("SdnUserProfile");
                profileConfiguration.HasProperty(  
                return preparedConfigurations;
            }
        }
    }

    Neither the MapType() nor the HasProperty() are recognized. What am i doing wrong?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    30 Dec 2010
    Link to this post
    Hello Preetham,

    The problem is that we use custom build of OA - 2010.2.1013.8. The fluent API you use was introduced with Q3 where OA team officially announced the Fluent API. Most probably we will upgrade the OA assemblies after the official release in our weekly builds.
    We also use the "old way" for mapping - Forward Mapping and actually you cannot use Default Mapping with Inheritance until we upgrade the referenced assembly in our code base and switch to the "new way" for mapping. This a task with higher priority for us and it we just need some time to convert all base logic.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered