I'm not sure if this is a problem with the generate views utility, with our DbContext, or if not a problem at all, but it appears to generate two equivalent views for each entity (with slightly different names):
if (extentName == "CodeFirstDatabase.User")
{
return GetView1();
}
// ...
if (extentName == "OurDbContext.Users")
{
return GetView145();
}
// ...
private static DbMappingView GetView1()
{
return new DbMappingView(@"
SELECT VALUE -- Constructing User
[CodeFirstDatabaseSchema.User](T1.User_UserId, T1.User_UserName)
FROM (
SELECT
T.UserId AS User_UserId,
T.UserName AS User_UserName,
True AS _from0
FROM OurDbContext.Users AS T
) AS T1");
}
// ...
private static DbMappingView GetView145()
{
return new DbMappingView(@"
SELECT VALUE -- Constructing Users
[Name.Space.User](T1.User_UserId, T1.User_UserName)
FROM (
SELECT
T.UserId AS User_UserId,
T.UserName AS User_UserName,
True AS _from0
FROM CodeFirstDatabase.User AS T
) AS T1");
}
This code first EF model has had numerous migrations over the past six or so years, so it would not surprise me if a vestige was hanging around.
I'm not sure if this is a problem with the generate views utility, with our DbContext, or if not a problem at all, but it appears to generate two equivalent views for each entity (with slightly different names):
This code first EF model has had numerous migrations over the past six or so years, so it would not surprise me if a vestige was hanging around.