From: Kijana Woodard <kijana.wood...@gmail.com>
Date: Mon, 9 Jul 2012 17:54:16 -0500
Local: Mon, Jul 9 2012 6:54 pm
Subject: Re: [RavenDB] Re: Order By calculated property
If you're using HiLo Ids, the sorting won't necessarily be "in order"
On Mon, Jul 9, 2012 at 4:57 PM, Matt Warren <mattd...@gmail.com> wrote:
> I don't think it's common, because you don't normally sort by id, you > normally have another fields you sort by (name, age, cost etc). And I can't > think of a scenario where you'd need to store the integer portion, other > than to sort on it. > On Monday, 9 July 2012 22:39:47 UTC+1, Jon Wynveen wrote:
>> Yeah, you're probably right that I answered my own question. I guess I'm
>> On Monday, July 9, 2012 4:34:32 PM UTC-5, Matt Warren wrote:
>>> I think you answered your own question as you asked it ;-)
>>> You can *only *sort on fields that are stored in the index, because
>>> On Monday, 9 July 2012 22:25:06 UTC+1, Jon Wynveen wrote:
>>>> Is there any way to order a query by a property that isn't stored in
>>>> What I'm trying to do is sort by the numeric ID instead of the full
>>>> Here is my User model:
>>>> public class User
>>>>> {
>>>>> public User()
>>>>> {
>>>>> Status = UserStatus.Active;
>>>>> }
>>>>> public string Id { get; set; }
>>>>> [JsonIgnore]
>>>>> public int UserId
>>>>> {
>>>>> get
>>>>> {
>>>>> int userId;
>>>>> int.TryParse(Id.Replace("**users/", ""), out userId);
>>>>> return userId;
>>>>> }
>>>>> }
>>>>> public string Username { get; set; }
>>>>> public string Password { get; set; }
>>>>> public string Email { get; set; }
>>>>> public string FirstName { get; set; }
>>>>> public string LastName { get; set; }
>>>>> public string Location { get; set; }
>>>>> public bool OptIn { get; set; }
>>>>>> public DateTime LastActivity { get; set; }
>>>>> public UserStatus Status { get; set; }
>>>>> public bool IsDeleted { get; set; }
>>>>>> public string[] RoleIds { get; set; }
>>>>>> [JsonIgnore]
>>>>> public string FullName
>>>>> {
>>>>> get {
>>>>> return !string.IsNullOrEmpty(**FirstName) || !string.IsNullOrEmpty(**
>>>>> ? string.Format("{0} {1}", FirstName, LastName)
>>>>> : null;
>>>>> }
>>>>> }
>>>>> }
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||