Timestamp version in fluent API

4 posts, 2 answers
  1. Vanward
    Vanward avatar
    6 posts
    Member since:
    Dec 2010

    Posted 04 Mar 2011 Link to this post

    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; }
    }



  2. Answer
    Serge
    Admin
    Serge avatar
    375 posts

    Posted 09 Mar 2011 Link to this post

    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!
  3. DevCraft banner
  4. Vanward
    Vanward avatar
    6 posts
    Member since:
    Dec 2010

    Posted 10 Mar 2011 Link to this post

    Thank you very much for your reply:)
    As I understand I need to define the "version" property as long and it will work?
  5. Answer
    Serge
    Admin
    Serge avatar
    375 posts

    Posted 15 Mar 2011 Link to this post

    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!
Back to Top