Click here to Skip to main content
15,902,938 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionProgramming Problem Pin
rksreadero19-Oct-10 17:11
rksreadero19-Oct-10 17:11 
AnswerRe: Programming Problem Pin
Abhinav S19-Oct-10 22:20
Abhinav S19-Oct-10 22:20 
AnswerRe: Programming Problem Pin
DaveyM6919-Oct-10 22:20
professionalDaveyM6919-Oct-10 22:20 
AnswerRe: Programming Problem Pin
Pete O'Hanlon19-Oct-10 23:43
mvePete O'Hanlon19-Oct-10 23:43 
QuestionRSS reader code problem. Pin
rksreadero19-Oct-10 16:38
rksreadero19-Oct-10 16:38 
QuestionWord c# interop bookmark issue(s) Pin
jboyd11119-Oct-10 9:53
jboyd11119-Oct-10 9:53 
AnswerRe: Word c# interop bookmark issue(s) Pin
Maciej Los19-Oct-10 10:30
mveMaciej Los19-Oct-10 10:30 
QuestionLearning Entity Framework [modified] Pin
Luca Leonardo Scorcia18-Oct-10 9:30
professionalLuca Leonardo Scorcia18-Oct-10 9:30 
Hello everybody. I'm asking for help in learning how to use this new MS product. As a developer of mainly LOB apps, I'm always interested in new ways to avoid the boilerplate code that's common when dealing with data layers. Except that after a few days dealing with EF4 I'm not finding any improvement, it seems to stomp on my feet on every basic real world requirement.
I read about model-first design and I found it a step in the right direction. So I built a simple model:

Customer <-> Order <-> Item

Built the associations and generated the MSSQL database. Nice!
Oops, it creates all fields as varchars. Right, I didn't tell him that the field OrderDate is a Date, so I change that and regenerate the script. Mmm? Drop table? I have to generate the ALTERs by hand?
Google and find the (beta) tools[^] to update my database automatically. This works, though I have to admit I only tried simple changes.
Fire up some tutorials. Learn about the different related windows in VS2010. Next lesson: entity splitting. I follow the tutorials and try to create a separate CustomerAddress entity, which I later merge into Customer. Seems to work, save and generate the DB scripts: the CustomerAddress entity is gone from the DB and the fields are merged into Customer, even without using the ALTER script power pack. WTF?
Ok, maybe entity splitting isn't so useful in real life, I can live with two separate entities and manual joins. Let's get back to studying the model. I see that by default it generates properties for the entity keys. I don't need them, recreate the entities to delete them (I didn't find any other obvious way). Regenerate the DB.
I notice that the FK columns are generated with a standard name: <ENTITYNAME>_<KEYNAME>, in my case the ugly Customer_CustomerId. I decide to change it into my familiar id_customer, and fail to find a suitable command. The properties window shows the name as readonly, the Mapping Details window doesn't let me specify another name, F2 does not do anything. It's readonly. So I take an axe and drill down into the edmx XML. Find/Replace seems to work, the model now seems ready to kick off a simple application and test queries. I only need to generate the DB... and it reverts my manual changes! Fields name are back to Customer_CustomerId! WTH!?

There must be some missing piece in my head. Am I doing something wrong? Is my VS installation borked? Does it work for you? Anybody took something in production using EF? How do you maintain an app without any machine help? Does it save even a minute over hand-crafted ADO.net data layers?

Thanks
Luca

The Price of Freedom is Eternal Vigilance. -- Wing Commander IV

En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur.
(But the best thing God has created, is a New Day.)
-- Sigur Ròs - Viðrar vel til loftárása

modified on Monday, October 18, 2010 6:56 PM

QuestionWill GetStream method always return same stream ? [modified] Pin
rahul.kulshreshtha15-Oct-10 21:25
rahul.kulshreshtha15-Oct-10 21:25 
AnswerRe: Will GetStream method always return same stream ? Pin
rahul.kulshreshtha16-Oct-10 0:57
rahul.kulshreshtha16-Oct-10 0:57 
QuestionTyped DataSet Grid View Pin
ganesh_IT14-Oct-10 23:10
ganesh_IT14-Oct-10 23:10 
AnswerRe: Typed DataSet Grid View Pin
Abhinav S15-Oct-10 3:24
Abhinav S15-Oct-10 3:24 
QuestionAdd New Row dynamically to Gridview Pin
SatyaKeerthi1514-Oct-10 22:51
SatyaKeerthi1514-Oct-10 22:51 
AnswerRe: Add New Row dynamically to Gridview Pin
Ravi Mori14-Oct-10 23:00
Ravi Mori14-Oct-10 23:00 
GeneralRe: Add New Row dynamically to Gridview Pin
SatyaKeerthi1515-Oct-10 0:07
SatyaKeerthi1515-Oct-10 0:07 
GeneralRe: Add New Row dynamically to Gridview Pin
Ravi Mori15-Oct-10 0:27
Ravi Mori15-Oct-10 0:27 
QuestionRetrive Data from Data Source Pin
ganesh_IT14-Oct-10 20:07
ganesh_IT14-Oct-10 20:07 
AnswerRe: Retrive Data from Data Source Pin
Ravi Mori14-Oct-10 20:54
Ravi Mori14-Oct-10 20:54 
Question.NET Framework Spell Checker Pin
MWRivera14-Oct-10 9:45
MWRivera14-Oct-10 9:45 
AnswerRe: .NET Framework Spell Checker Pin
Luc Pattyn14-Oct-10 10:04
sitebuilderLuc Pattyn14-Oct-10 10:04 
GeneralRe: .NET Framework Spell Checker Pin
MWRivera14-Oct-10 10:13
MWRivera14-Oct-10 10:13 
GeneralRe: .NET Framework Spell Checker Pin
Luc Pattyn14-Oct-10 10:31
sitebuilderLuc Pattyn14-Oct-10 10:31 
GeneralRe: .NET Framework Spell Checker Pin
MWRivera14-Oct-10 10:33
MWRivera14-Oct-10 10:33 
AnswerRe: .NET Framework Spell Checker Pin
Pete O'Hanlon14-Oct-10 10:07
mvePete O'Hanlon14-Oct-10 10:07 
GeneralRe: .NET Framework Spell Checker Pin
MWRivera14-Oct-10 10:17
MWRivera14-Oct-10 10:17 

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.