On 28 March 2012 19:16, Peter Maddin <[email protected]> wrote:

> Great!****
>
> Thanks every one for their suggestions****
>
> This works well****
>
> <snip>
>
>        var individual = query.FirstOrDefault();****
>
>        if(individual == null) individual = new Admin();****
>
>
>
All of your samples have this. In VB.NET there is the two-valued If
statement that can simplify this to

 Dim individual = If(query.FirstOrDefault, New Admin())

I believe the C# equivalent is

 var individual = query.FirstOrDefault()??(new Admin());

-- 
Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

Reply via email to