1

Closed

Change order of attributes

description

Consider de folowing class:
class Test
{
    public int id { get; set; }
    public DateTime Date { get; set; }
    public string Name { get; set; }
    public Test()
    {

    }
}
If I want to change the order of the attributes name and date like this:
class Test
{
    public int id { get; set; }
    public string Name { get; set; }
    public DateTime Date { get; set; }        
    public Test()
    {

    }
}
The views doesnt update, so it executes the sql the wrong way, get and set value for the db column name with a date and the other way around.

Is this something than can be worked around?
Closed May 20, 2015 at 4:08 PM by moozzyk
No further details provided. Closing.

comments

moozzyk wrote May 10, 2015 at 4:39 AM

The order of the properties should not matter for view generations. This was changed in EF6 because before sometimes the order was on 32-bit machines was different than on 64-bit machines even though the code was the same. Here are the corresponding issues on the EF side:
http://entityframework.codeplex.com/workitem/816
http://entityframework.codeplex.com/workitem/26

As long as the queries are semantically correct and produce the same results it should not matter if they look different. If the queries are not correct please attach a repro.