2016-04-18 12:41 GMT+01:00 Erik H <[email protected]>:
>
> public static bool operator >=(JaarEnMaand jaarEnMaand1,
>> JaarEnMaand jaarEnMaand2)
>> {
>> if (jaarEnMaand1.Jaar == jaarEnMaand2.Jaar)
>> {
>> return (jaarEnMaand1.Maand >= jaarEnMaand2.Maand);
>> }
>> return (jaarEnMaand1.Jaar >= jaarEnMaand2.Jaar);
>> }
>>
>>
>
> *Model:*
>
>> public class AsapInput : Entity{
>
> public virtual JaarEnMaand AsapVerwerkingsPeriode { get; set; }
>> }
>>
>
>
> *LINQ statement:*
>
>> .Where(ai => ai.AsapVerwerkingsPeriode >=
>> periodeVanaf && ai.AsapVerwerkingsPeriode <= periodeTm && ( //niet
>> geblokkeerde beschikbaarstellingen en premie inhoudingen
>> (ai.Type == AsapInputType.Beschikbaarstelling ||
>> ai.Type == AsapInputType.BrutoPremieInhouding || ai.Type ==
>> AsapInputType.NettoPremieInhouding) &&
>> ai.Uitkeringscomponent.Bron !=
>> UitkeringscomponentBron.HandmatigplanUC));
>
>
>
> .Where(ai => ai.Uitkeringsplan.Contractnummer ==
>> contract || ai.Uitkeringsplan.Contractnummer == contract.PadLeft(20, '0'))
>
>
>
>
> *CORRECT* Generated SQL where statment in *NHibernate 2.1.2.400*:
>
>> WHERE ((
>>
>> this_.asapverwerkingsperiodemaand >= @p0
>> AND
>> this_.asapverwerkingsperiodejaar >= @p1
>>
>
But this is NOT correct! At least it doesn't match your C# implementation
for arbitrary values of periods:
C# 2005-06 >= 2004-07 => ((2005==2004 AND 06>=07)) OR (2005>=2004) =>
TRUE
SQL 2005-06 >= 2004-07 => (2005>=2004 AND 06>=07) => FALSE
/Oskar
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.