a bug, but probably it is in your DB or in your mapping if you are
generating the DB through NH.

On Thu, Dec 2, 2010 at 1:12 PM, Alexander Kot <[email protected]>wrote:

> Hello
>
> I am playing with NH 3.0 b2
> I have entity with string PK Code
> Fluent mapping is used
> ............
> Id(x =>
>
> x.Code).Column("CODE").Length(5).Not.Nullable().Unique().GeneratedBy.Assigned();
>
> field code has nchar(5) type in DB
>
> Having such condition it will be next
> var lst = (from x in ses.Query<Entity>() select x).ToList();
> var ent = ses.Get<Entity>("XX");
> Assert.IsTrue(lst.Contains(ent));  //!!! this will fail
>
> //It will be 2 object instantiated here one with PK = "XX   " form
> LINQ and one with PK="XX" from Get
> so this will be OK
>
> var lst = (from x in ses.Query<Entity>() select x).ToList();
> var ent = ses.Get<Entity>("XX   ");  //3 additional spaces
> Assert.IsTrue(lst.Contains(ent));
>
> Is that bug or behavior by design?
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to