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

Timestamp version in fluent API

3 Answers 120 Views
Databases and Data Types
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 04 Mar 2011, 03:24 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; }
}



3 Answers, 1 is accepted

Sort by
0
Accepted
Serge
Telerik team
answered on 09 Mar 2011, 08:18 PM
Hi Vanward,

 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.

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!
0
Vanward
Top achievements
Rank 2
answered on 10 Mar 2011, 09:00 AM
Thank you very much for your reply:)
As I understand I need to define the "version" property as long and it will work?
0
Accepted
Serge
Telerik team
answered on 15 Mar 2011, 07:19 PM
Hi Vanward,

 You are correct, this should be the only thing you need to configure in order to get this to work, however if you do face further trouble be sure to let us know. If you have problems a sample project will be most appreciated and the easiest way for us to help you.

I hope this is helpful. 

Greetings,
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
Databases and Data Types
Asked by
Vanward
Top achievements
Rank 2
Answers by
Serge
Telerik team
Vanward
Top achievements
Rank 2
Share this question
or