Click here to Skip to main content
15,881,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: Internet connection Pin
Wes Aday10-Aug-12 11:02
professionalWes Aday10-Aug-12 11:02 
AnswerRe: Internet connection Pin
Richard Andrew x6410-Aug-12 12:24
professionalRichard Andrew x6410-Aug-12 12:24 
AnswerRe: Internet connection Pin
jschell10-Aug-12 12:26
jschell10-Aug-12 12:26 
AnswerRe: Internet connection Pin
PIEBALDconsult11-Aug-12 6:55
mvePIEBALDconsult11-Aug-12 6:55 
QuestionCOM + Windows 7 Pin
Member 81371059-Aug-12 11:21
Member 81371059-Aug-12 11:21 
Questionndroid apps using C# Pin
UL UL ALBAB9-Aug-12 7:45
UL UL ALBAB9-Aug-12 7:45 
AnswerRe: ndroid apps using C# Pin
Paul Conrad9-Aug-12 8:35
professionalPaul Conrad9-Aug-12 8:35 
QuestionQuestions For Entity Framework Gurus Pin
Kevin Marois9-Aug-12 7:00
professionalKevin Marois9-Aug-12 7:00 
I'm going through a decent EF 4.0 book, and a couple of things came to mind.

I'm used to using LINQ To SQL, in my DAL I have standard CRUD methods, such as:

public void UpdateCompany(CompanyEntity Company)
{
    using (var dc = getDataContext())
    {
        var company = (from c in dc.Companies
                        where c.CompanyId == Company.Id
                        select c).First();
        if (company != null)
        {
            company.CompanyName = Company.CompanyName;
            company.IsActive = Company.IsActive;
            try
            {
                dc.SubmitChanges();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
    }
}


1) If I understand what I'm reading correctly, you wouldn't really do this, as creating a new instance of the data context in each method won't work because of the change tracking in EF. It seems like you would use a single instance of the dataj context. I could use an example of a DAL that works with EF, if anyone has one.

2) Also, in my example I'm using my own entities, which are simple POCO's. Using EF I would use the entities that were generated. But they seem rather heavy compared to POCO's. In a situation where the DAL was accessed via a WCF app, would you use these entities?

Thanks
If it's not broken, fix it until it is

AnswerRe: Questions For Entity Framework Gurus Pin
Ed Hill _5_9-Aug-12 22:12
Ed Hill _5_9-Aug-12 22:12 
AnswerRe: Questions For Entity Framework Gurus Pin
Pete O'Hanlon9-Aug-12 22:29
mvePete O'Hanlon9-Aug-12 22:29 
QuestionChange Buttonfield image dynamically Pin
Alagiri.periyasamy@merrillcorp.com9-Aug-12 4:41
Alagiri.periyasamy@merrillcorp.com9-Aug-12 4:41 
AnswerRe: Change Buttonfield image dynamically PinPopular
Pete O'Hanlon9-Aug-12 5:27
mvePete O'Hanlon9-Aug-12 5:27 
QuestionThe configuration section cannot contain a CDATA or text element. Pin
Alagiri.periyasamy@merrillcorp.com9-Aug-12 1:23
Alagiri.periyasamy@merrillcorp.com9-Aug-12 1:23 
AnswerRe: The configuration section cannot contain a CDATA or text element. Pin
Eddy Vluggen9-Aug-12 1:26
professionalEddy Vluggen9-Aug-12 1:26 
AnswerRe: The configuration section cannot contain a CDATA or text element. Pin
Peter_in_27809-Aug-12 1:29
professionalPeter_in_27809-Aug-12 1:29 
QuestionA question about closing socket Pin
tiwal8-Aug-12 23:55
tiwal8-Aug-12 23:55 
AnswerRe: A question about closing socket Pin
Philip Stuyck9-Aug-12 11:24
Philip Stuyck9-Aug-12 11:24 
GeneralRe: A question about closing socket Pin
tiwal9-Aug-12 22:56
tiwal9-Aug-12 22:56 
QuestionHow to write Events in Asp .Net Pin
Member 84809808-Aug-12 22:37
Member 84809808-Aug-12 22:37 
AnswerRe: How to write Events in Asp .Net Pin
Ed Hill _5_8-Aug-12 23:09
Ed Hill _5_8-Aug-12 23:09 
AnswerMessage Closed Pin
8-Aug-12 23:32
Alagiri.periyasamy@merrillcorp.com8-Aug-12 23:32 
SuggestionRe: How to write Events in Asp .Net Pin
Shameel8-Aug-12 23:54
professionalShameel8-Aug-12 23:54 
AnswerRe: How to write Events in Asp .Net Pin
BobJanova9-Aug-12 2:13
BobJanova9-Aug-12 2:13 
GeneralRe: How to write Events in Asp .Net Pin
Member 84809809-Aug-12 18:42
Member 84809809-Aug-12 18:42 
Generalres://ieframe.dll/navcancl.htm#http://localhost:2441/ErrorPage.aspx?ErrorId= Pin
Alagiri.periyasamy@merrillcorp.com8-Aug-12 21:13
Alagiri.periyasamy@merrillcorp.com8-Aug-12 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.