Redirect to an action from baseController in MVC

In Asp.net MVC, in order to redirect to an action you can call RedirectToAction(actionName, ControllerName) easily. But if you would have to do it in baseController, it doesn't work! For example if you want to check the nullability of the user session you should initialize the Result of filterContext like this:

  1. protected override void OnActionExecuting(ActionExecutingContext filterContext)
  2. {
  3. if (CurrentUser == null)
  4.        ... Continue

Multiple submit buttons in asp.net MVC

In asp.net MVC you can submit a form by @using(Html.BeginForm()). You can Post the model you have binded via this operation and command the begin form to post to a Post action:   @using(Html.BeginForm("Create","FooController")).

Now if you have more than one submit button to send the page content to different post action, there are few ways: one of them is to post the content to a specific action and then decide in it to redirect which action:

 Razor:

  1. <input type="submit" value="Field1" name=&quo... Continue

Why you can't project mapped entity in entity framework

If you have worked with entity framework for a long time with and linq of course, you probably have seen the Error: The entity cannot be constructed in a LINQ to Entities query. So when it happens and why? Think about the following peace of code:

  1. public IQueryable<Lesson> GetAllLessons(int termId)
  2. {
  3.     return from p in db.Lessons
  4.            where p.termId == termId
  5.            select ... Continue

Polymorphic Methods in java

Polymorphism is an object oriented programming concept that literally is being in many shapes. polymorphism allows you to define one interface and have multiple implementations. Polymorphism in Java has two types: Compile time and Runtime. When you are overloading the methods it's static polymorphism and when you are overriding methods it's dynamic polym... Continue

Workflow as a Service

As you know in some complex services, WCF services will not be sufficient; Situation like online shopping in line transaction (the most famous sample!). you may choose workflow services in these kinds of cases to implement logic via work flow and expose it via windows communication services. With the .NET Framework 3.5, Microsoft has provided additional components to integrate workflows with (WCF) and The result of this integration is called workflow services.

Microsoft workflow like other workflows is implemented by activities and it is consist of two activities: sequence and flo... Continue

Ember Data

Ember.Js is another popular web application framework to build single page application based on MVC pattern. There is an interesting feature in ember which lets you handle integrated templates to update automatically when the underlying data changes by ensuring your HTML. Ember Data is just a data persistence library such as JSON API that maps client-side models to server-side data. You know, it provides something like ORM in client side.

Ember Data provides two adaptors: RESTAdapter and FixtureAdapterThe RESTAdapter is configured for use b... Continue

Why should I define container classes in C++

What's a container class?

It's a class which is used to hold objects in memory or external storage to clumping variables of the same type to make the sorting, searching, … easier. A container could store many entities and provide direct access to them like string class.  Needless to say, The size of the container depends on the number of the objects it contains. A Container usually defined as a class that gives you the power to store any type of data. A container class acts as a generic holder.

a container class is in two kinds: Heterogeneous and homo... Continue

Characteristics of Meteor

Just a few hours ago I read some cool stuff about another JS library called Meteor. The story of Meteor doesn't stop on a simple library or framework. There are some claims in documentation of Meteor web site which seems interesting:

  1. Meteor makes it an order of magnitude simpler
  2. You can build a complete application in a weekend via Meteor
  3. No longer do you need to provision server resources
  4. You don’t need to manage database, ORM or broadcast data invalid... Continue

BrightstarDB and its different targets

I was looking for NoSQL databases in Wikipedia, in Graph databases section I saw an open source data storage written in Dot Net. After exploring the source code I found that it would be so cool. This library seems to be more easier than Neo4J to getting started. I don't know exactly how graph database work and also how BrightstarDB works.

 

BrightstartDB

 

 

In the ... Continue