Click here to Skip to main content
16,001,979 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all:

I am working in asp.net MVC2 application and I have question related to design of model. I have an edmx file which has all the entities. I have a viewmodel named whiteoutviewmodel which uses Three list of entities and three other collections like this:
&
public class WhiteoutViewModel { public List Servers { get; set; }
public List Whiteouts { get; set; } public List Fields { get; set; }

    public ArrayList Hours {get;set;}
    public ArrayList Minutes {get;set;}
    public ArrayList AMPM {get;set;}
    public ArrayList RepeatList{get;set;}
}
I have created a view based on this Viewmodel. Now I need a partial view which should be of type Whiteouts . I have created a whiteout class and added some properties in it.

  public class WhiteoutDTO
    {
        public int WhiteoutId { get; set; }
        public int FieldId { get; set; }

        public int StartHour { get; set; }
        public int StartMinute { get; set; }
        public string StartTime { get; set; }

        public int EndHour { get; set; }
        public int EndMinute { get; set; }
        public string EndTime { get; set; }

        public string Repeats { get; set; }
        public bool IsActive { get; set; }

        public enmDays Days { get; set; }
    }

Now I have two Whiteout class. One is from edmx and one that I created. Do I need to make my partial view of type edmx or the one I created ? The reason I created my class is that I needed some properties which are not in database table/edmx whiteout. Should I make my whiteout class as property of above ViewModel?

Please suggest.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900