![Page 1: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/1.jpg)
Building CLR/H Registration Site
with
ASP.NET MVC4 and EF4.1 Code First
![Page 2: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/2.jpg)
Requirements of registration site.
• Attendees can do registration from Web.
– Entry name, e-mail, twitter id ...
• Share attendees list only within CLR/H staffs.
– The list is used by staff at reception.
![Page 3: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/3.jpg)
Today’s key words
ASP.NET MVC4 Visual Studio
11 Beta
Entity Framework 4.1
Code First
Twitter Bootstrap
AppHarbor
ASP.NET
Web API
Git
Web Pages View
“Razor” Syntax
SQL
Server
2012
LocalDB
NuGet
![Page 4: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/4.jpg)
Create It!
Live Demo
![Page 5: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/5.jpg)
Publish to internet It!
Next step...
![Page 6: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/6.jpg)
Why AppHarbor?
• The most reason is... I interested in it! :)
• Second reason, it is low cost at start up.
– Form $0 for ASP.NET Web Site hosting.
– From $0 fot Rent SQL Server (20MB limited).
![Page 7: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/7.jpg)
Notice
• You must store the all NuGet packages which
installed into Git repository.
– I tried “NuGet Package Restore” feature, but it didn’t work.
• EF4CodeFirst “DropDatabase” initializer
doesn’t work.
– Because the database is not mine.
It is only rental.
So, we can not drop it.
– You must use “CreateTablesOnly” initializer.
(install from NuGet.)
![Page 8: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/8.jpg)
Publish to internet It!
Live Demo
![Page 9: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/9.jpg)
Authenticate & Authorize It!
Next step...
![Page 10: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/10.jpg)
How to
authentication?
![Page 11: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/11.jpg)
Windows
authentication?
![Page 12: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/12.jpg)
No.
It is internet site,
not intranet.
![Page 13: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/13.jpg)
Forms
authentication?
![Page 14: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/14.jpg)
Sorry.
I do not choose
Forms
authentication
today.
![Page 15: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/15.jpg)
My choice is...
![Page 16: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/16.jpg)
HTTP
Basic
Authentication!
![Page 17: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/17.jpg)
Why HTTP Basic Authentication?
• Becase, it is HTTP standard.
• So that, we can authenticate any clients by
standard way.
• For example...
Microsoft Excel
“Web Query” feature!
![Page 18: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/18.jpg)
How to add in Basic auth function
in your Web app?
• Not use IIS function.
– It depend on Windows local user account, or
Active Directoy.
• Instead, install “HTTP Auth Module” from
NuGet.
![Page 19: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/19.jpg)
Authenticate & Authorize It!
Live Demo
![Page 20: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/20.jpg)
Provide web api!
Next step...
![Page 21: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/21.jpg)
Provide web api!
Live Demo
![Page 22: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/22.jpg)
Extra Stage!
Next step...
![Page 23: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/23.jpg)
I think, it is not Best solution...
• There is no function to manage user
account s, yet...
– We can configure HTTP Auth Module to use
MembershipProvider, but...
• Excel Web Query is Very convenient, but it
is not full automatic.
– We have to sync manualy.
![Page 24: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/24.jpg)
I have an idea :)
![Page 25: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/25.jpg)
Spread Sheet :P
![Page 26: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/26.jpg)
Using Google Spread as a Database
• Install “GDataDB” from NuGet!
• Then, you can use Google Spread Sheet as
a Database.
– Spread Sheet Documents = Databases
– Work Sheets = Tables
– Rows = Entities
– Columns = Properties of Entity
– Column name mapped to property name.
![Page 27: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/27.jpg)
Store into Google It!
Live Demo
![Page 28: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/28.jpg)
Advantage
• Easy to share and access control.
– Based on Google Documet platform.
• Nothing to do.
– “Sync” is not required.
• But... It is very slow :(
– It is not “real” database.
![Page 29: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/29.jpg)
Conclusion.
At last...
![Page 30: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/30.jpg)
• VS11 is very powerfull, and EF41CodeFirst
allows you to develop rapidly!
• You can get anything you want from NuGet!
– Many many usefull libraries, modulues...
– Many many nice girl friends...
• Excel Web Query is nice feature!
– Keep the way to HTTP standard.
• You can publish your Web apps without cost by
AppHarbor!
– With SQL Server, not only Web app hosting!
![Page 31: Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst](https://reader036.vdocuments.site/reader036/viewer/2022081514/555e76c7d8b42a34098b5723/html5/thumbnails/31.jpg)
Thank you!