Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
AnswerRe: XDocument.Save() reversing attribute order Pin
Dave Kreskowiak11-Aug-12 4:13
mveDave Kreskowiak11-Aug-12 4:13 
AnswerRe: XDocument.Save() reversing attribute order Pin
jschell11-Aug-12 7:35
jschell11-Aug-12 7:35 
AnswerRe: XDocument.Save() reversing attribute order Pin
Abhinav S11-Aug-12 18:59
Abhinav S11-Aug-12 18:59 
Questionhow to create multiple countdown timer in one page in asp.net Pin
Sumit Malviya10-Aug-12 23:05
Sumit Malviya10-Aug-12 23:05 
AnswerRe: how to create multiple countdown timer in one page in asp.net Pin
Eddy Vluggen10-Aug-12 23:51
professionalEddy Vluggen10-Aug-12 23:51 
QuestionSQL + C# Pin
jojoba201110-Aug-12 21:42
jojoba201110-Aug-12 21:42 
AnswerRe: SQL + C# Pin
dan!sh 10-Aug-12 22:13
professional dan!sh 10-Aug-12 22:13 
QuestionRe: SQL + C# Pin
jojoba201111-Aug-12 18:01
jojoba201111-Aug-12 18:01 
Questionoutput App.Config to DLL Pin
Jassim Rahma10-Aug-12 12:25
Jassim Rahma10-Aug-12 12:25 
AnswerRe: output App.Config to DLL Pin
Wes Aday10-Aug-12 13:59
professionalWes Aday10-Aug-12 13:59 
GeneralRe: output App.Config to DLL Pin
Jassim Rahma11-Aug-12 4:32
Jassim Rahma11-Aug-12 4:32 
GeneralRe: output App.Config to DLL Pin
Wes Aday11-Aug-12 4:54
professionalWes Aday11-Aug-12 4:54 
AnswerRe: output App.Config to DLL Pin
Pete O'Hanlon10-Aug-12 23:08
mvePete O'Hanlon10-Aug-12 23:08 
AnswerRe: output App.Config to DLL Pin
Mycroft Holmes12-Aug-12 18:36
professionalMycroft Holmes12-Aug-12 18:36 
QuestionInternet connection Pin
Fred 3410-Aug-12 10:54
Fred 3410-Aug-12 10:54 
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 

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.