Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts
Monday, June 24, 2013
Npgsql's status for supporting EntityFramework
Labels:
ASP.NET MVC,
PostgreSQL
In this article (Npgsql Code First Entity Framework 4.3.1 Sample), I have learned that the current version of Npgsql - PostgreSQL's .NET Driver - only supports EntityFramework4, NOT supports EntityFramework5. And it the next article (Initial EF-6 support added to Npgsql), the next version of npgsql will support EntityFramework6 (may support EntityFramework5).
Monday, November 19, 2012
I've finished reading "Programming Microsoft ASP.NET MVC, Second Edition"
Labels:
ASP.NET MVC,
book
I've finished reading the Japanese edition of "Programming Microsoft® ASP.NET MVC, Second Edition".
- This book deals with ASP.NET MVC just literally. In other words, This book does not deal with EntityFramework.
- But, this book is useful for understanding internal architecture of ASP.NET MVC 3.
- Japanese edition's appendix (about ASP.NET MVC 4) is not enough, so I wait for its next edition!
Tuesday, September 18, 2012
VWDExpress 2012 goes green for F#
Labels:
ASP.NET MVC,
F#
A week ago, Micsosoft announced about F# Tools for Visual Studio 2012 Express for Web in this blog. That is the biggest reason for using VWDExpress 2012 instead of VWDExpress 2010.
And This can install F# MVC4 tools.
And This can install F# MVC4 tools.
Tuesday, August 21, 2012
cache_page directive for ASP.NET MVC
Labels:
ASP.NET MVC,
book
In Ruby on Rails, we should cache the response of the page with cache_page directive on controller.
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should use System.Web.Mvc.OutputCacheAttribute class on each actions like below:
The advantage of rails way is there are two directives: cache_page and cache_action. cache_page does not execute any actions and filters, but, cache_action only executes filters while ASP.NET MVC has only OutputCache attritbute that does not execute any actions and filters too.
On the other hand, the advantage of ASP.NET MVC way is easy to define expiration seconds of caching while rails' one is more difficult.
class SampleController < ApplicationController
caches_page :home
caches_action :home_with_filter
def home
...
end
def home_with_filter
...
end
end
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should use System.Web.Mvc.OutputCacheAttribute class on each actions like below:
public class SampleController : Controller
[OutputCache(Duration=10)]
public ActionResult Home()
{
...
}
end
The advantage of rails way is there are two directives: cache_page and cache_action. cache_page does not execute any actions and filters, but, cache_action only executes filters while ASP.NET MVC has only OutputCache attritbute that does not execute any actions and filters too.
On the other hand, the advantage of ASP.NET MVC way is easy to define expiration seconds of caching while rails' one is more difficult.
Thursday, August 16, 2012
ASP.NET MVC 4 is also ready for VWDExpress 2010 too.
Labels:
ASP.NET MVC
In these days, Many Microsoft products comes to RTM. These products are for Windows 8 , .NET 4.5, Visual Studio 2012 and so forth. But, ASP.NET MVC 4 is also ready for Visual Studio 2010 and VWDExpress 2010 (in other words, ASP.NET MVC 4 runs on .NET 4.0 too).
After installation, dialog contains some projects related with ASP.NET MVC 4 like below:
- (English) ASP.NET MVC 4 for Visual Studio 2010 SP1 and Visual Web Developer 2010 SP1
- (Japanese) Visual Studio 2010 SP1 および Visual Web Developer 2010 SP1 用 ASP.NET MVC 4
After installation, dialog contains some projects related with ASP.NET MVC 4 like below:
Saturday, August 4, 2012
errors.add for ASP.NET MVC
Labels:
ASP.NET MVC,
book
In Ruby on Rails, we should add error information of model with errors.add method from ActiveModel::Errors class.
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should add error information of model with ViewData.ModelState.AddModelError method from System.Web.Mvc.ModelStateDictionary class.
errors.add(:customer, 'Invalid country.')
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should add error information of model with ViewData.ModelState.AddModelError method from System.Web.Mvc.ModelStateDictionary class.
ViewData.ModelState.AddModelError("Customer", "Invalid country.");
Thursday, July 19, 2012
Protect mass assignment for ASP.NET MVC
Labels:
ASP.NET MVC,
book
In Ruby on Rails, we should protect mass assignment with defining attr_protected (black list) or attr_accessible (white list) on Model like this (via Ruby on Rails Guides).
(black list)
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should protect mass assignment with defining attribute on argument of Action method, not on Model directly.
(black list)
The best advantage of this approach is to be able to define black lists or white lists in each actions.
(black list)
class SomeModel(white list)
attr_protected :admin
...
end
class SomeModel
attr_accessible :name
...
end
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should protect mass assignment with defining attribute on argument of Action method, not on Model directly.
(black list)
[HttpPost](white list)
public ActionResult Create([Bind(Exclude="admin")]SomeModel model)
{
...
}
[HttpPost]
public ActionResult Create([Bind(Include="name")]SomeModel model)
{
...
}
The best advantage of this approach is to be able to define black lists or white lists in each actions.
Monday, July 16, 2012
routes.MapRoute
Labels:
ASP.NET MVC,
book
In Ruby on Rails, we define request route on config/route.rb as DSL like this:
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we define request route (1) on Global.asax as RegisterRoutes method or (2) on XXXXAreaRegistration.cs as RegisterArea method, in ASP.NEt MVC. This is the sample:
If we want to set default value for route, add anonymous object as 3rd parameter:
And then, if we want to set constraint for route, add anonymous object as 4th parameter:
match ':controller(/:action(/:id))(.:format)'
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we define request route (1) on Global.asax as RegisterRoutes method or (2) on XXXXAreaRegistration.cs as RegisterArea method, in ASP.NEt MVC. This is the sample:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}" // URL with parameters
);
}
If we want to set default value for route, add anonymous object as 3rd parameter:
public static void RegisterRoutes(RouteCollection routes)In this sample, UrlParameter.Optional means the rest of parameters.
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Default value for parameters
);
}
And then, if we want to set constraint for route, add anonymous object as 4th parameter:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Default value for parameters
new { id = @"\d{8}" } // Constraint for parameters
);
}
Friday, June 15, 2012
Windows 8 release preview and ASP.NET MVC4
Labels:
ASP.NET MVC
2 weeks ago, Windows 8 release preview and Visual Studio 2012 RC had been released. As you see, "Visual Studio 11" has been renamed to "Visual Studio 2012", and Express SKUs are ready. So I try "Visual Studio Express 2012 for Web" to develop ASP.NET MVC4.


Monday, May 7, 2012
Start reading "Programming Microsoft ASP.NET MVC, Second Edition"
Labels:
ASP.NET MVC,
book
I have started reading the Japanese edition of "Programming Microsoft® ASP.NET MVC, Second Edition".
The cover of English edition is below:
But, Japanese edition contains the great appendix - about ASP.NET MVC 4.
- Programming Microsoft® ASP.NET MVC, Second Edition
- (Japanese Edition) Programming Microsoft ASP.NET MVC 3
The cover of English edition is below:
But, Japanese edition contains the great appendix - about ASP.NET MVC 4.
Saturday, April 7, 2012
ASP.NET MVC becomes Bazaar model
Labels:
ASP.NET MVC
About 2 weeks ago, ASP.NET MVC becomes Bazaar model.
ASP.NET MVC, Web API, Razor and Open Source
ASP.NET MVC Now Accepting Pull Requests
In other words,
ASP.NET MVC, Web API, Razor and Open Source
ASP.NET MVC Now Accepting Pull Requests
In other words,
- ASP.NET MVC had started to accept pull request from outside
- ASP.NET MVC changed its license from Ms-PL to Apache Licence
Monday, March 12, 2012
Windows 8 customer preview and ASP.NET MVC4
Labels:
ASP.NET MVC
2 weeks ago, Windows 8 customer preview and Visual Studio 11 beta had been released. The most notable feature for me is that Visual Web Development supports ASP.NET MVC4 by default. Now I'm learning.
Tuesday, February 21, 2012
The future of MVC4
Labels:
ASP.NET MVC
One week ago, Microsoft announced that ASP.NET MVC4 beta had been released. And Scott Guthrie said some important things in his blog like below:
- ASP.NET MVC4 installer contains EntityFramework 4.3
- ASP.NET MVC4 installer contains Razor template engine v2
- ASP.NET MVC4 only supports .NET Framework 4 and VisualStudio 2010. In other words, it doesn't support .NET Framework 4.5 and VisualStudio 11 at this beta release. These all will be supported at RTW in this September.
Wednesday, October 12, 2011
MySQL Connector/Net 6.4.4 has been released
Labels:
ASP.NET MVC,
MariaDB
In two weeks ago, MySQL Connector/Net 6.4.4 has been released(Check change log).
You may think this release is small bug-fix one. But, for ASP.NET MVC3 / EntityFramework4 developer, this contains big change. Since this release, "Code first" function runs correctly with PluralizingTableNameConvention. So you don't have to remove this convention like this post anymore!
You may think this release is small bug-fix one. But, for ASP.NET MVC3 / EntityFramework4 developer, this contains big change. Since this release, "Code first" function runs correctly with PluralizingTableNameConvention. So you don't have to remove this convention like this post anymore!
Wednesday, July 13, 2011
ViewBag is not living in redirected action
Labels:
ASP.NET MVC
Wednesday, July 6, 2011
Updated MySQL Connector/Net
Labels:
ASP.NET MVC,
MariaDB
Current MySQL Connector/Net is 6.3.7, and this version can do code first in limited condition. This post expresses the instruction of code first with MariaDB.
Tuesday, June 28, 2011
Selected as an LTer
Labels:
ASP.NET MVC,
Ruby,
rubykaigi2011
I've selected as an Lightning Talker in RubyKaigi2011.
Lightning talks 1 - July 17, 2011 (Main Hall)
My LT title is Yet Another "ASP.NET MVC 3 vs. Ruby on Rails 3".
I will do my best!!
Lightning talks 1 - July 17, 2011 (Main Hall)
My LT title is Yet Another "ASP.NET MVC 3 vs. Ruby on Rails 3".
I will do my best!!
Goodies
RubyKaigi staffs release some goodies in here.Thursday, May 26, 2011
Yet another simple way to associate One-To-One relation and to modify both tables.
Labels:
ASP.NET MVC
There's a sample to associate One-To-One relation and to modify both tables in ASP.NET MVC3.
- Creating a More Complex Data Model for an ASP.NET MVC Application (4 of 10)
- Reading Related Data with the Entity Framework in an ASP.NET MVC Application (5 of 10)
Wednesday, April 20, 2011
Enable ASP.NET Web Site Administration Tool with MariaDB on MVC3
Labels:
ASP.NET MVC,
MariaDB
(continued from phosphorescence: Create Simple MVC 3 App with VWDExpress and MariaDB)
If you want to use the system built in ASP.NET with MariaDB, you should do some configurations. This article is referring this article.


If you want to use the system built in ASP.NET with MariaDB, you should do some configurations. This article is referring this article.
Create schema for aspnetdb on MariaDB
Like in this post, create the schema named as aspnetdb and special user for aspnetdb schema.

Monday, April 18, 2011
Create Simple MVC3 App with VWDExpress and MariaDB
Labels:
ASP.NET MVC,
MariaDB
(continued from phosphorescence: Prepare MVC 3 with VWDExpress and MariaDB)
Then, create new MVC 3 project following the wizard. In this sample, I name this project as Mvc3Training. If xunit.net is installed, you can choose test project in the wizard.

Create new MVC 3 project
Launch Visual Web Development 2010 Express, and at first, set the default development web server as IIS Express. [Tools]-[Options]-[Project or Solution]-[Web projdct], turn on the checkbox.Then, create new MVC 3 project following the wizard. In this sample, I name this project as Mvc3Training. If xunit.net is installed, you can choose test project in the wizard.

Subscribe to:
Posts (Atom)





