🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #22431

Re: EntityFramework problem

#22431
From: mk
Date: Fri, 24 Aug 2012 13:07
14 lines
1575 bytes
2012-08-23 18:02, yamma wrote:
> W dniu czwartek, 16 sierpnia 2012 16:18:00 UTC+2 użytkownik mk napisał:
>
>> Customer cust = context.Customers.Single(x => x.ID == 1);
>
> Jestes pewien, ze zmienna cust nie zawiera wartosci null?
> yamma
>

O ile dobrze wiem to SingleOrDefault() może zwrócić nulla. Samo Single() 
jesli nie potrafi znaleźć jednego rekordu rzuca wyjątek. Ale oczywiście 
upewnię się.

Mariusz
Technical Details
Message-ID: <50377ca0$0$1312$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <502d0116$0$1225$65785112@news.neostrada.pl> <74c14f78-c6ed-4c35-8bef-39e0f6131522@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Date: Fri, 24 Aug 2012 15:07:42 +0200
From: mk <mk@nospam.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
Newsgroups: alt.pl.comp.lang.csharp
Subject: Re: EntityFramework problem
References: <502d0116$0$1225$65785112@news.neostrada.pl> <74c14f78-c6ed-4c35-8bef-39e0f6131522@googlegroups.com>
In-Reply-To: <74c14f78-c6ed-4c35-8bef-39e0f6131522@googlegroups.com>
Lines: 14
Message-ID: <50377ca0$0$1312$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 79.189.213.122
X-Trace: 1345813665 unt-rea-a-02.news.neostrada.pl 1312 79.189.213.122:62685
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit