This is a migrated thread and some comments may be shown as answers.

Fluent Mapping Properties MissingFieldException

1 Answer 76 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roman
Top achievements
Rank 1
Roman asked on 26 Oct 2014, 12:02 PM
Hi,

i'm using Telerik Data Access 2014.2.918.1 and the Fluent API.
I have models which use a custom libary named Catel (http://catelproject.com).
The properties in Catel have no real backing field. Example:

  public partial class Country : ModelBase
    {
        [System.ComponentModel.DataAnnotations.Required()]
        [System.ComponentModel.DataAnnotations.Key()]
        public virtual Guid Id
        {
            get
            {
                return GetValue<Guid>(IdProperty);
            }
            set
            {
                SetValue(IdProperty, value);
            }
        }

        public static readonly PropertyData IdProperty = RegisterProperty<Country, Guid>(o => o.Id);
    }

            configuration.HasProperty(x => x.Id).IsIdentity(KeyGenerator.Autoinc).WithDataAccessKind(DataAccessKind.ReadWrite).ToColumn("Id").IsNotNullable().HasColumnType("uniqueidentifier").HasPrecision(0).HasScale(0).HasDefaultValue();

Catel supports entity framework but i want to use Telerik Data Access.
How do i map the Id property with Fluent API without getting the MissingFieldException error? Thanks!

1 Answer, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 29 Oct 2014, 06:46 PM
Hi Markus,

Unfortunately you have bumped against a limitation in Telerik Data Access. The issue is that your base class generated by the Catel module is in different assembly than the other persistent classes and the Enhancer cannot find and process the fields from the base class.

If any other questions arise, do not hesitate to contact us again.

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Getting Started
Asked by
Roman
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Share this question
or