» Home » Model » Page 1
Model binding in controller when form is posted - why to use view model instead of class from domain model?
Category : Programming Languages

I'm still reasonably new to ASP.NET MVC 3. I have come across view models and their use for passing data from a controller to the view. In my recent question on model binding two experts suggested that I should use view models for model binding as well.

This is something I haven't come across before. But both guys have assured me that it is best practise. Could someone maybe shed so

View Replies

EF 4.3 CodeFirst MVC3 WebApp and console use same model, but somehow they 'see' a different model which results in a model backing error
Category : Programming Languages

I'm using the same model for multiple applications: MVC3 web app, Windows services, and a console application. When I start the MVC3 web app, it generates the database. I can restart it, and everything is fine. But when I start the console application I get an error:

The model backing the '...Context' context has changed since the
database was created. Consider using Code

View Replies

Rails - Belongs_to Model, where Model can be any model implementing the relationship?
Category : Development Tools & Services

Is it possible to implement, in Rails 3, an association

class ApiCredentials < ActiveRecord::Base
belongs_to Model

where Model can be any model.

Then in the api_credentials table, I have fields like model_id and model to track this association.

I don't assume that

View Replies

Need help creating a Model and migration for Tag model for Post model (Rails)
Category : Programming Languages

I have a Post model and I would like to create a Tag model so that posts can have tags (more than one at a time). I want to be able to search a post's tags and search posts tagged as X.

This is what I've realized so far in order to make this work (correct me if I'm wrong):

The Tag model only needs a :name attribute and the Post model needs a :tag_list

View Replies

Checkboxes for models, two submit buttons: add person model to group model, reject person model from group model
Category : Web Design

I've looked at formset and model formset at Django many times, but I still can't figure the smart way to do this.

I have two models:



I have a queryset that contains all the persons trying to join a particular group: Person.objects.filter(wantsToJoinGroup=groupD)

Now, what I want to do

View Replies

MVVM WCF Entity as Model… How to implement propertychange notification in the view model when using Entity as your model
Category : Coding

I am implementing an MVVM Pattern using Entity as my model... When I instantiate the Model in the setter I add a propertychanged handler to the object to capture the field changes within the entity object...

When I step through code I find that after I modify the field within the object it is firing the Property Change event multiple times...
It has led me to believe that I ha

View Replies

Adjecency List Model OR Nested Set Model, which data model should I use to store my hierarchiecal data?
Category : Databases

I have to store messages that my web app fetch from Twitter into a local database. The purpose of storing messages is that I need to display these messages in a hierarchical order i.e. certain messages(i.e. status updates) that user input through my application are child nodes of others (I have to show them as sub-list item of parent message). Which data model should I use Adjacency List Model

View Replies

Can I use a model as Inline on a model where the foreign key is over another model?
Category : Web Design

This are my models:

class Image(models.Model):
class Size(models.Model):
image = models.ForeignKey(Image)
class Physical(models.Model):
size = models.ForeignKey(Size)

I'm trying to add Size and Physical as an Inline on ImageAdmin. The user has to create some sizes, before he can add some physi

View Replies

How to model this in django (inherited model, where each inherited model has a unique method)
Category : Programming Languages

How to model this in django:

1) have a base network of manufacturers

2) under each network their might be several distributors

3) a user of the system can access items through the distributor

4) if a user access the item through the distributor we want that item to be translated where each manufacturer will have their own translation

View Replies

Error in Model classes after creating Model.Context and Model classes in ASP.Net MVC 4
Category : ASP & ASP.net

I have generated xxxModel.Context and xxxModel template (in Models) from an existing database using EF 4.1 on ASP.Net MVC 4 application. After that when I build the project it gives the error for all the Model classes (POCO) saying "The type file name already contains a definition for memeber variable name". Where am I going wrong?

Thanks for help.

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .