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

[Solved] Timestamp version in fluent API

1 Answer 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vanward
Top achievements
Rank 2
Vanward asked on 08 Mar 2011, 07:26 PM
Hello.

I have trouble with fluent configuration.
I try define mapping for Version column (byte[] in model, timestamp in DB), but the method HasProperty no overload for the data type byte[]. How should I declare the version?
public class User
{
    public string Name { get; set; }
  
    public int PasswordSalt { get; set; }
  
    public string Email { get; set; }
  
    public UserStatus Status { get; set; }
  
    public DateTime? LastActivityDate { get; set; }
  
    public DateTime RegistrationDate { get; set; }
  
    public Guid ActivationKey { get; set; }
  
    public Guid ApproveKey { get; set; }
  
    public DateTime? ApproveDate { get; set; }
  
    public byte[] Version { get; set; }
}


1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 09 Mar 2011, 08:21 PM
Hello Vanward,

  I have answered you in the other forum post but let me paste my answer here as well. 

 Unfortunately the current version of the Fluent Mapping API does not allow for mapping byte[] properties as version. However OpenAccess and SqlServer do allow for the timestamp column to be mapped to either long or byte[]. 

 If you were to change the type of the version column to long you will be able to define your mapping. We will work on this issue and fix it in the following release. 

I hope this is helpful, please do let us know if you face further trouble.

Kind regards,
Serge
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Vanward
Top achievements
Rank 2
Answers by
Serge
Telerik team
Share this question
or