Learning Resources for Entity Framework 5 - asp.net

My team is looking to shift asp.net form application from .NET 4 to .NET 4.5. We are hoping that we would be able to use the whole new Entity Framework 5. Being the in charge of this task I did look into the advantages of using EF5 and I am quite impressed.
EF5 gives you the ability to run pre-compiled Queries and that will be a great performance boost.
Apart from that we would be able to use enums and table-valued functions, that I am not very excited about but lets see how these can improve Code Quality and maintenance.
My Question is, are there any good resources that can help me learn some practical implication of EF5. I have been searching for some time and hope that there are people out there who have already jumped to EF5 and can post some useful resources in here.

The answer is not exactly about EF but for "MVC with EF".
I'm learning MVC these days & I've learned quite a bit. I would like to share my experience and how the whole training can be highly effective. If you go systematic, everything is simple and cool. I would advise you to first cover some basic concepts which are used in MVC and entity framework:
Extension Types
Lambda Expression
LINQ
Anonymous Types
You can find good information on these at http://www.youtube.com/watch?v=FejRZ6QYWHw.
If you already know that you can skip.
Next you can start learning the EF. You can do so by following Lynda Tutorials which I found to be extremely simple and effective (avoid Plurasight as of now).
You can also visit asp.net website and check the Getting started with EF6 using MVC 5. It has wonderful list of articles, which I would recommend to everyone.
And once you are done with that, you should be capable enough to build any web application. If you want more higher level details you can then opt for Plurasight tutorials.
Hope this helps.

Related

Best practices for Entity Framework Code First deployment

I am creating an ASP.Net MVC 5 website with EF Code First. Although I have written a lot of code and have worked in this business for a long time, I have no experience in deploying a managed website. It seems to me that the goal of EF Code First approach is to create a DB that just works and it's no good for real world deployment.
If that's the case, I was wondering if there is a conference talk, tutorial or other type of resource that I can use to learn about best practices for this purpose. Especially learning how to create a secure and sophisticated database from the scheme of my existing one.
I've searched around and read a lot of opinions about this and got a little confused. Since I'm using MVC 5, I think there are some old and some new ways to do this so I'm asking your advice to pick the best method that works for me.

How can MVC 3 Architecture be used along with WF4 in .Net 4.0 Framework

I need help / advice on the below scenario.
We are planning to develop a web application which can handles millions of transaction per week with the below technologies.
1. WF4 for Work Flow definition / Business logic etc..
2. WPF for Application Design
Question 1:
We are also considering MVC3. Is it really necessary to use MVC3 with WF4 or we can go ahead with the traditional WebForms? We have absolutely no idea and we are confused. Ultimately we want to increase the developers productivity time by decrease the coding time.
Question 2:
Is it possible to use MVC3 with WF4? If so, please provide me some resources. There is very limited resources for this combo.
Your help is appreciated.
Performance in MVC is going to be better 'out of the box' so to say because of the lack of viewstate and the ability for lightweight responses using JSON.
If you are looking at a high performance site and aren't sure what to use - I would recommend MVC. There will be a slight learning curve but in the end I think you will be thankful you did. Unit testing alone is so much easier.
re workflow:
Since code can trigger off a workflow, you absolutely can use it. Just call your workflow, there's nothing special there.
The first google result for running from asp.net
http://msdn.microsoft.com/en-us/magazine/cc163623.aspx
You can expose your workflow via a service, call directly, etc.

Microsoft WebMatrix: what is it?

I'm a little confused about new Microsoft products.
I'm a classic webform Asp.Net developer. I know exists also Asp.Net MVC with a different approach based on Mvc pattern.
Now, i know exists also WebMatrix that uses new Razor "notation".
Can someone explain me what are the main difference between that "technology" ? When use WebMatrix, when WebForm ?
Thanks!
Webmatrix is a platform that integrates a variety of recently released technologies such as IIS Express, Asp.Net Webforms, Razor, SQL Express etc. I guess from what I have been reading it's a way that eases the barrier to entry, for non-MS developers, into the MS world. In addition you can also use code your site in PHP and use a variety of open source tools for developing web sites. To directly answer your question, in you planning on creating a complex web application, WebMatrix may not be the solution you're looking for.
As a reference, I suggest reading through Scott Gu's Introduction to Webmatrix
WebMatrix will be able to take
advantage of these technologies to
facilitate a simplified web
development workload that is useful
beyond professional development
scenarios – and which enables even
more developers to be able to learn
and take advantage of ASP.NET for a
wider variety of scenarios on the web.
If you are a professional developer
who has spent years with .NET you will
likely look at the below steps and
think – this scenario is so basic -
you need to understand so much more
than just this to build a “real”
application. What about encapsulated
business logic, data access layers,
ORMs, etc? Well, if you are building
a critical business application that
you want to be maintainable for years
then you do need to understand and
think about these scenarios.
Imagine, though, that you are trying
to teach a friend or one of your
children how to build their first
simple application – and they are new
to programming. Variables,
if-statements, loops, and plain old
HTML are still concepts they are
likely grappling with. Classes and
objects are concepts they haven’t even
heard of yet. Helping them get a
scenario like below up and running
quickly (without requiring them to
master lots of new concepts and steps)
will make it much more likely that
they’ll be successful – and hopefully
cause them to want to continue to
learn more.
One of the things we are trying to-do
with WebMatrix is reach an audience
who might eventually be able to be
advanced VS/.NET developers – but who
find the first learning step today too
daunting, and who struggle to get
started.
If someone is still interested: a pretty good lessons here http://habrahabr.ru/company/microsoft/blog/136004/ . This link is for those, who understand russian.
Shortly speaking WebMatrix allows you to conveniently mix up C# server code and html (this mixing is provided by simple Razor sytax). Also in WbeMatrix 2.0(beta version now) is provided full IntelliSense for html/css/c# code.

What to learn - Ruby on Rails or ASP .NET MVC...given that am familiar with ASP .NET [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I need to learn and adpot the MVC methodology for building web apps. Which is the better way to go given that I have experience with ASP .NET Webforms - ASP .NET MVC or Ruby on Rails?
I've heard people going gaga over RoR and its simplicity and its features such as scaffolding, ActiveRecord, convention over configuration etc.
However, I fail to see what is so great about these. Most of them sound basic (the kind you'll not really want to use in production code - scaffolding for example) - and most of them sound like they are there in ASP .NET MVC in some form or the other.
Why should I consider learning RoR over ASP .NET MVC?
Are there benefits I do not know about or am unable to perceive?
I suggest you learn both!
I'm a professional ASP.Net developer by day, and a hobbyist RoR developer by night. Learning RoR will in fact make you a better .Net developer, and it's fun!
Also consider that one day you may in fact be able to write an ASP.NET MVC app in IronRuby instead of fussy old c# :)
There are many reasons I would recommend learning RoR over MVC
It's a much more mature stack. It's been around since 2005.
You get to learn a new programming language. "They" say you should learn a new programming language every year.
There is a very rich set of extensions to the base stack. Eg. HAML, Authentication gems, profiling and the list goes on and on.
You get to use database migrations out of the box. Something that is a bit of a breakthrough in database configuration management.
Dynamic languages give you a massive amount of flexibility.
That said: ASP.Net MVC is an awesome framework from Microsoft. I am not advocating dumping your stack and moving to the dark side. I just think it helps to have a broad understanding when it comes to technology.
If you're familiar with the Microsoft stack (Windows, IIS, SQL, ASP.NET) but not so familiar with the Linux stack (Apache, MySql, etc), then going with ASP.NET MVC over Ruby on Rails will cost you a lot less in the long run, in time spent on learning infrastructure.
I suggest you take a look at the job market in your area, and choose what will increase your opportunities. Ruby on Rails is a great framework, but if nobody in your area cares or uses it, then it won't do you any good to learn it (speaking from a career perspective - there are lots of reasons it would benefit you from a learning perspective). I was faced with this dilemma recently and gave it a lot of thought; since my area is pretty much 99% .Net based and that's what companies want, I decided to focus on MVC and becoming an "expert" in ASP.NET instead of learning RoR, since there's no demand for RoR. I actually wasted two months learning RoR before I realized that it would help me personally, but not professionally.
That said, if you're planning on striking out on your own then choose whichever one you feel more comfortable with. If you already know Asp.Net though, I'd recommend taking a look at the MVC framework first since it leverages what you already know, but I heartily suggest looking at picking up Ruby, if not the Rails framework, since it's a very good scripting language for many tasks.
I would recommend learning one at a time. The biggest part of of learning a new language or method of programming is learning the best practices and changing how you approach a programming problem. Not just the syntax. Jumping into two at once will leave you with bad habits in both.
Because you already know ASP.NET I think learning ASP.NET MVC would be the logical next step. Get a solid understanding of MVC concepts and THEN try a project or two in Ruby on Rails. The two frameworks approach some things differently. You may find that your style and preferences fit one better than the other. But either way, now you know both. Can't hurt right?
However, I fail to see what is so
great about these. Most of them sound
basic (the kind you'll not really want
to use in production code -
scaffolding for example) - and most of
them sound like they are there in ASP
.NET MVC in some form or the other.
The ability to rapid prototype a website is part of what makes RoR so popular. When designing a website for a client there's a big difference between a non-functional mock and a functional mock.
I believe the feature gab between ASP.NET MVC and RoR will continue to get smaller. Eventually the choice will come down to a question of Windows vs LAMP.
I would spend a few weeks with RoR. It's extremely simple to get it installed and up and running so you can develop with it. Then it's just a matter of following a few tutorials until you've covered most of the basics. Then decide if you want to continue with RoR or stick with ASP.NET MVC.
if you already know c# and you were working with asp.net webforms, try asp.net mvc...and when you learn it, you can improve your skills with RoR as I am planning to...
cheers
Personally I would invest the time in learning both. I have done this and although I ended up going with MVC for my current project, the decision was because I didn't have the time to invest in learning Ruby language. The RoR framework on the other hand you can get within a few nights and get going with webpages, validation, CRUD e.t.c. in no time at all. However when you need to start adding domain logic, learning about gems you may need to understand Ruby.
Another reason is I already have a hosting setup for Microsoft, and I know c# and the .net framework and the resources I'll need already so although it's less mature and isn't as feature-rich as RoR, I deduced I could get further faster with MVC.
To make the decision yourself, weigh all the options, spend a week with MVC ( use the book MVC in Action ) and spend a week with RoR (use the book Agile Web Development with Ruby on Rails 3rd Edition ) these will get you going within no time. Then when you decide on one or the other you will have a more knowledgeable perspective.
Considering Stack Overflow is written with ASP.NET MVC I think it might be sacrilege to promote RoR over MVC.
MVC has pretty much given Microsoft lovers one more tool that they don't need to go elsewhere to get.

Prerequisite knowledge for ASP.NET MVC

After being frustrated in my attempts to learn the arcana that is ASP.NET, I decided to try ASP.NET MVC.
I have extensive experience with C# 2.0 doing just about everything (WinForms, Windows Services, remoting, ...) except ASP.NET . I've been writing PHP for even longer than I've been coding .NET. With all of this experience, I thought I was ready for ASP.NET MVC. I now see I'm learning the following simultaneously and having a bit of a hard time with it:
the MVC pattern in general
ASP.NET
ASP.NET MVC
.NET 3.5.
I'm currently about 1/2 way through the NerdDinner free book chapter. I don't feel completely lost but I do get the feeling that I'm not catching on to as much as I'd like to (due to the fact that I'm learning 4 things at once -- sometimes it's not clear which skills are from which abstraction layer).
What prerequisite knowledge would you recommend for ASP.NET MVC? Any/all of those I listed above? Others? Or maybe I'm just slow and most people would be fine doing what I did.
I have been an ASP.Net developer for just 3 years now. I got a project from a friend and decided to develop it using ASP.Net MVC to learn this new stuff.
I must admit I felt lost in the beginning as well, but then I saw some very interesting articles on the ASP.Net/MVC site. At the bottom are 7 iterations which will give you a very detailed of what you are doing while you are doing it.
I used the Products example they have there and applied sortof the same to my own project.
After all the iterations, I now feel like I have a very good base to start learning the more advanced MVC implementations. (JQuery plugins/Ajax/...)
http://www.asp.net/learn/mvc/
I think some basic understanding of ASP.Net is a base requirement. If you have that, you should be able to get through this with just a little bit of motivation.
"MVC pattern in general" - no need but useful.
ASP.NET - also not necessary.
.NET 3.5 - yes. It will be your working tool, you should master it.
Very useful would be the understanding of multi-tier architecture since this time you will have to think first about how you organize your application, opposite to direct hacking with controls in WebForms.
Also you will not avoid knowledge of HTML/CSS, maybe JavaScript.
Just don't be scared. Do it one step at a time and you will get it. Just don't read too much. Practice it.
Lots of highly useful tutorials are to be found here: ASP.NET MVC Tutorials
Also read blogs from ASP.NET MVC "parents":
http://haacked.com
http://weblogs.asp.net/scottgu/default.aspx
http://www.hanselman.com/
http://stephenwalther.com/blog/Default.aspx
I have a similar background. I have used .Net/C# since its inception, but all system related, no web experience. About 8 months ago, I decided that I wanted to learn about the web and decided that for me ASP.NET MVC seemed like the right way to go. I don't feel that my lack of ASP.NET experience was too much of a hindrance. I used the http://www.asp.net/mvc/ site as the center for my learning. All the videos are good, plus the tutorials and all the sample projects. I have downloaded most of them and have enough familiarity that when I can't figure something out I go to one of the downloaded projects with a similar requirement and look to see how it was coded. Knowing no web technology, I also ordered books on HTML, CSS, JAVA script, AJAX and Jquery. For me the best way to learn is to develop a project, so that it what I did. Most of the authors of the new MVC books also have blogs with lots of good information. When I started to learn about MVC, the MVC books hadn't been published yet, but I am sure there are some good ones out there by now or that will be available soon.
I have enjoyed the new experience and have learned a lot, I think the new technology is great. Good Luck!
I recommend getting a book on ASP.NET MVC and working through the examples in the book. Don't worry too much about the history of the MVC design pattern or it's 1979 roots at Xerox PARC. I wouldn't bother reading much more about the actual MVC pattern than this simple article from MSDN: Cutting Edge: ASP.NET Presentation Patterns
I recently finished Steve Sanderson's Pro ASP.NET MVC Framework and I can recommend it. It has a multiple chapter sample application that gets you started quickly with ASP.NET MVC and then 10 or so follow-up chapters that cover the relevant topics in depth (Controllers, Views, Security, etc). The book has a strong focus on unit testing and dependency injection and also covers basic object relational mapping with LINQ to SQL. There is also chapters that cover integrating jQuery with ASP.NET MVC and how you might utilize framework components (authorization, membership, roles, personalization, caching, etc) from traditional WebForms applications.
There are a number of positive reviews on Steve's Blog which is also a good source of additional ASP.NET information. Amazon.com has a couple of positive reviews on the book (I need to add mine when I get some free time). You can also preview some of the book over at Google Books.
Some of the other books that are available now or available shortly are:
Wrox: Beginning ASP.NET MVC 1.0 --- Both authors
Keyvan Nayyeri and Simone Chiaretta are active ASP.NET MVC bloggers. There is a sample chapter on testing for download here. I've read that it should be available at the end of June 2009?
Manning: ASP.NET MVC in Action --- This book is by Ben Scheirman, Jeffrey Palermo and Jimmy Bogard. They all have interesting blogs that cover ASP.NET MVC related topics. If I heard correctly, this book should be out in August 2009. You can pre-order the book (MEAP = Manning Early Access Program) here and get access to the first 11 chapters (unedited or loosely edited I think). The CodeCampServer reference application that complements the book is pretty intense and covers using nHibernate (ORM), Castle Windsor (DI / IoC), DDD, unit, integration and regression testing.
Wrox: Professional ASP.NET MVC 1.0 --- This is the book that accompanies the NerdDinner sample application and reader that was made available a while back. It's authored by some pretty smart Microsoft guys: Rob Conery, Scott Guthrie, Scott Hanselmann and Phil Haaaaaaaaaaaaack who have the inside information on why certain decisions were made with the framework. Available now.
Packt: ASP.NET MVC 1.0 Quickly --- The author Maarten Balliauw has a pretty good blog that talks about various ASP.NET MVC issues including testing. Available now.
Sams: ASP.NET MVC Framework Unleashed --- Author Stephen Walther is responsible for a number of popular ASP.NET Unleashed books from the early 1.0 days of ASP.NET and now he is writing a book on ASP.NET MVC. You can check out his blog for sample content from the upcoming book and other ASP.NET MVC related posts. Amazon says this book will be available in July 2009.
Wrox: ASP.NET MVC Website Programming Problem Design Solution --- This appears to be a follow-up to the book Wrox: ASP.NET 2.0 Website Programming: Problem Design Solution and welcomes back author Marco Bellinaso and introduces two new authors to the project Nick Berardi and Al Katawazi. The sample application for the book is the Beerhouse CMS and is available for download on CodePlex. The book's website says that it will be released in June 2009.
I think once one wraps one's head around the idea that MVC uses routing to direct requests straight to classes (which use a model for connections and a view for display) rather than showing "actual" pages, the concept of MVC in a web application really presents itself more clearly. With the 'difficulty of concept' out of the way, it's a lot easier to consider those attributes and make a decision whether MVC is suited to a particular application.
edit -- having said that, if I were new to ASP.NET, I would probably tackle the forms version first and get a good understanding of events, postback, and the methodology of that system before going into MVC because ASP.NET MVC is really handled on top of that system.
edit 2 - I think I got voted down before finishing my edits :-(
This is a good introduction from Martin Fowler. He talks in detail about GUI Architectures.
Start reading some material on the following topics and they will really help you gear yourself towards any MVC in general. Here are some topics that you can look up online:
Routing.
The MVC Pattern.
Controllers and Actions.
Mapping parameters.
ActionResults.
Error handling.
Action filtering.
Passing data to a view.
HTML Helpers.
View rendering extensibility.
Using jQuery with ASP.NET MVC.
Best practice tips for views, controllers, and models.
MVC Anti-patterns.
If you don't already know Webforms, then stick to learning just MVC right now so that you don't confuse yourself. Webforms is a useful thing to know, and since you know Winforms already, it shouldn't be too hard to learn afterward.
MVC and Webforms both work under ASP.NET, so a lot of things you'll learn while playing with MVC will carry over to Webforms.
It might help to approach Asp.Net MVC from a different angle: Read the Agile Web Development With Rails book, follow along (implement using Rails), and try to implement a project of similar scope to what's in that book in ASP.Net MVC.
You'll pick up Rails quickly (a week or two of hacking around a couple of hours a night), and the explication of the conventions of Rails will guide you into a mindset that aligns fairly closely with the Asp.Net MVC way. It'll probably help you understand the motivations for MVC along the way, and you'll certainly have opinions about how things "should" work in Asp.net MVC.
I would spend some time on ASP.NET first before learning ASP.NET MVC. Remember, ASP.NET MVC is based on ASP.NET. Some things from traditional ASP.NET won't be used with the MVC model (user controls, (ASCX and ASPX files)) but it is a good thing to still understand these. If you want to focus on MVC, first learn ASP.NET but do not spend time studying the common controls or databinding.
The rest of ASP.NET is still useful (HttpModules, HttpHandlers, the web.config file, the membership provider, etc) when you're doing ASP.NET MVC, and I'd say likely a prerequisite to really using ASP.NET MVC well.
That said, there is a lot more work for ASP.NET out there than ASP.NET MVC. Some employers are looking for people who know MVC, but they are mainly doing that as they are looking for people who are passionate about learning new things. My concern with ASP.NET MVC is that I don't see how to integrate it with traditional ASP.NET applications. The reality is most jobs out there involve working with an existing codebase, not starting from scratch.
I'd been following ASP.Net MVC pretty much from the beginning, and I have to say, I love it. Combined with Unity (or another DI framework) it just flows nicely. I've always liked a certain separation of concerns principle anyhow, and favored ASP.Net over PHP (and classic ASP). I didn't always like the control pattern of ASP.Net though. MVC fits much better. And with Json() and PartialView() for return types interacting with jQuery.getJSON() and $("#mydiv").load() is very simplified on the server-side. It also works well when following SOLID Design principles...
It does help to have a solid understanding of HTML and JavaScript (AJAX, DHTML) for more interactive points. It also helps to think in terms of the MVC pattern, or not thinking about cluttering your controller and your data.
One thing I don't care as much for, is the lack of a built in skinning system, for multiple skins on a web-app. I've come around this, and having the source really helps. I would say as other have suggested, follow the blogs (and read back) of
Phil Haack,
Scott Guthrie, and
Scott Hanselman. They all have vital information. Beyond this, as also mentioned, the demos on the ASP.Net MVC Website are very good.
Apart from what others have recomended I would suggest the following two books:
Spring in Action : It's not ASP.NET MVC, it's about Spring, but the foundations are similar and it's really well written.
Pro ASP.NET MVC 2 Framework : It explains the concepts in an easy to follow way, and it helps introduce DI into ASP.NET MVC.
All previous post are so cool :) but i want to add my own view. Without some base of asp.net runtime mechanism you can't write a good app. This info you could get from dino esposito book(he has two books about asp.net 2.0 - basic and advanced level) in basic level - there is one chapter about processing incoming request - you could read only this chapter.
If you know what is httpapplication, httpruntime, request, response etc. just skip my answer.
I know from my brief time with a Ruby on Rails job, coming back to ASP.NET and working with MVC it was easy to apply what I learned from RoR to ASP.NET MVC. Truthfully, ASP.NET MVC is actually just about the VC part and not much about the Model since ASP.NET doesn't have to be very REST based whereas RoR practically enforces it.
The problem I find is trying to get people to learn correct conventions of MVC when they are first learning it by coming from ASP.NET itself. Like others have mentioned, it might be a good idea to learn a true MVC platform (in this case RoR) because trying to apply what you know about ASP.NET to a MVC architecture. A good place to start with RoR is http://railsforzombies.org/ It's also kind of fun and will give you the basics for what really goes where in the ideal REST MVC scenario. After that apply what you know to the MVC for ASP.NET.
The very first and basic thing with ASP.Net MVC is the Routing concepts. LEarn this well first. You can also go throught System.Web.Routing Namespace on getting some more idea on this. Routing is just telling the IIS that is there is a request for a particular extension then redirect to this handler.
The next thing would "Convention over configuration". For MVC you need to have a particular folder structure like Controller,Model and Views .Nothing more mystery here.

Resources