Tuesday, July 30, 2013

: One to many relationship and ObjectStateManager error

Understand basic navigation with Entity Framework Code First (4.3) with 1 to many relationship


Entity Framework 4.3: An object with the same key already exists in the ObjectStateManager
http://patrickdesjardins.com/blog/entity-framework-4-3-an-object-with-the-same-key-already-exists-in-the-objectstatemanager

Microsoft Links : MVC 3, MVC 4 tutorials

Table of Contents

MVC 4

·         ASP.NET MVC 4 Mobile Features
·         Bundling and Minification
·         Custom MVC Template

MVC Music Store

·         Part 2: Controllers
·         Part 3: Views and ViewModels
·         Part 4: Models and Data Access

Getting Started with EF using MVC

·         ASP.NET Data Access Content Map

Views

·         Dynamic v. Strongly Typed Views

Controllers and Routing

·         Creating Custom Routes (C#)
·         Creating Custom Routes (VB)

Security

JavaScript

Deployment

Getting Started with ASP.NET MVC3

Older Versions

·         Getting Started With MVC
·         Models (Data)
·         ASP.NET MVC Views
·         Controllers and Routing
·         Deployment
·         Security
·         Unit Testing
·         Contact Manager
·         NerdDinner
·         Movie Database
·         JavaScript
·         Overview

Hands On Labs

·         What's New in ASP.NET MVC 4
·         ASP.NET MVC 4 Fundamentals

MVC 5

·         Introduction to ASP.NET MVC 5


Monday, July 22, 2013

Some More MVC links

1. Difference between MVC and ASP :

http://msdn.microsoft.com/en-us/library/dd381412(v=vs.98).aspx




2. Razor Syntax

MS Article : Introduction to ASP.NET Web Programming Using the Razor Syntax (C#)

http://www.asp.net/web-pages/tutorials/basics/2-introduction-to-asp-net-web-programming-using-the-razor-syntax


C# Razor Syntax Quick Reference



3. Shivaprasad MVC tutorials :

http://www.dotnetfunda.com/articles/article1846-mvc-tutorial-number-12-what-is-razor-in-mvc-3.aspx


4. A good basic tutorial and contains many links :

ASP.NET MVC3 Razor With jQuery For Beginners




5.httpnotfound

ASP.NET MVC 3: Using HttpNotFoundResult action result

http://weblogs.asp.net/gunnarpeipman/archive/2010/07/27/asp-net-mvc-3-using-httpnotfoundresult-action-result.aspx



6. Types of helpers in MVC :

form, url and html.



===========================
action is any public method in a controller.

If a public method in a controller is not supposed to work as action, it should be decorated with [NonAction] attribute.


Base to all action results is ActionResult

Types of ActionResult :
ViewResult
PartialViewResult
RedirectResult
RedirectToRouteResult
ContentResult
JsonResult
JavaScriptResult
FileResult
EmptyResult



========================
what is @Scripts.Render ?

what is RenderSection ?what is @RenderBody ?
what are <section> , <nav> tags ?

========================



Tuesday, May 28, 2013

MVC Links : Types of filters and other misc tech info

MVC

http://www.codeproject.com/Articles/577776/AplusBeginner-27splusTutorialplusforplusUnderstand


Type of filters

Now taking this discussion further, Let us first discuss the various types of filters that can be implemented to inject custom processing logic.
 • Authorization filter
• Action filter
• Result filter
• Exception filter



Order of Execution

IAuthorizationFilter.OnAuthorization
2. IActionFilter.OnActionExecuting
3. IActionFilter.OnActionExecuted
4. IResultFilter.OnResultExecuting
5. IResultFilter.OnResultExecuted

In case there is an exception, OnException will will be called as instead of the result filters.

===============

http://www.dotnet-tricks.com/Tutorial/mvc/4XDc110313-return-View()-vs-return-RedirectToAction()-vs-return-Redirect()-vs-return-RedirectToRoute().html

return View() vs return RedirectToAction() vs return Redirect() vs return RedirectToRoute()

================

http://www.dotnet-tricks.com/Tutorial/mvc/Q8V2130113-RenderPartial-vs-RenderAction-vs-Partial-vs-Action-in-MVC-Razor.html

RenderPartial vs RenderAction vs Partial vs Action in MVC Razor

================

MVC Step By Step Tutorial on codeproject link



http://www.codeproject.com/Articles/552846/Why-s-How-s-of-Asp-Net-MVC-Part-1

  1. Why(s) & How(s) of Asp.Net MVC Part 1 - MVC Basics
  2. Why(s) & How(s) of Asp.Net MVC Part 2 - Playing with Asp.Net MVC
  3. Why(s) & How(s) of Asp.Net MVC Part 3 - DB First
  4. Why(s) & How(s) of Asp.Net MVC Part 4 - Model First
  5. Why(s) & How(s) of Asp.Net MVC Part 5 - Code First



Learn MVC (Model view controller) Step by Step in 7 days – Day 2

MVC Error : CS0103: The name 'Scripts' does not exist in the current context



CS0103: The name 'Scripts' does not exist in the current context



Source Error:

@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}


The solution is

1. Also install  "Microsoft ASP.NET Web Optimization Framework" package from NuGet
2. Include <add namespace="System.Web.Optimization"> in both web.configs.


Views Web.config

    <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Helpers"/>
      </namespaces>


Root Web.config


      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Web.Optimization"/>      
      </namespaces>






















Sunday, May 26, 2013

MVC uses other design patterns ....


A good point to ponder over; is this really so ?

http://www.codeproject.com/Articles/552846/Why-s-How-s-of-Asp-Net-MVC-Part-1


Design Patterns in MVC 

Even though MVC is design pattern itself, the entire MVC framework contains some design patterns itself. Below is a list of design parrens used in MVC (or Asp.Net MVC) regardless the platforms. Detaild description of these patterns in MVC are out of the scope of this post, I am sure you can google and could know much more about them.   
Front ControllerConsolidates all request handling by channeling requests through a central controller.
StrategyThe View-Controller relationship, The way conroller hookup view at runtime.
Factory MethodSpecify the default controller class for a view
DecoratorIn the context of MVC, decorator could fit into your views.
ObserverOne Model, Multiples views ( observers/subscribers ), and the publisher manages the communication
MediatorSeveral different Models, Several views, and the mediator manages the communications between them.

Comparing features of LangGraph vs CrewAI

LangGraph Orchestration vs CrewAI Orchestration The following table compares LangGraph and CrewAI orchestration across their menta...