Entity Framework question
Posted: Mon 05 Mar 2012 08:24
Sorry for the bad subject, but I didn't know how to summarize the questions I need to do.
1) Model First relationship
When I have a relationship between two classes in the Model First scenario, the code generated is something like that:
Is it possible to change int in:
In the first scenario, I always have to check if the relationship is null or I will have a "NullReferenceException" at runtime.
In the second scenario, no exception but simply no results.
2) When do you think to have enum support on Model First/Code First? (if you know, of course)
3) When do you think to improve Code First for stored procedure support? (as before, if you know that)
Thank you in advance.
1) Model First relationship
When I have a relationship between two classes in the Model First scenario, the code generated is something like that:
Code: Select all
public Collection ClassBs
{
get
{
return _classbCollection;
}
set
{
_classbCollection = value;
}
}
private Collection _classbCollection;
Code: Select all
public Collection ClassBs
{
get
{
if (_classbCollection == null)
{
_classbCollection = new Collection();
}
return _classbCollection;
}
set
{
_classbCollection = value;
}
}
private Collection _classbCollection;
In the second scenario, no exception but simply no results.
2) When do you think to have enum support on Model First/Code First? (if you know, of course)
3) When do you think to improve Code First for stored procedure support? (as before, if you know that)
Thank you in advance.