I have a very simple view in SQL Server that looks something like this: Where Show is the result of a LEFT JOIN with a Symbol table:
+---------+----------+----------------------+ | Name | Surname | Show | +---------+----------+----------------------+ | Enoch | Thompson | The Boardwalk Empire | | Anthony | Soprano | The Sopranos | | Walter | White | Breaking Bad | +---------+----------+----------------------+
When I get this table through the Entity Framework context.CharacterView.ToList() in my application, the result is as follows:
+---------+----------+----------------------+ | Name | Surname | Show | +---------+----------+----------------------+ | Enoch | Thompson | The Boardwalk Empire | | Anthony | Soprano | The Boardwalk Empire | | Walter | White | The Boardwalk Empire | +---------+----------+----------------------+
However, in the CharacterView database, it is just as it should be.
Create view request
CREATE VIEW CharacterView AS SELECT c.Name AS [Name], c.Surname AS [Surname], s.Name AS [Show] FROM [dbo].[Characters] AS c LEFT OUTER JOIN [dbo].[Shows] AS scen ON c.ShowId = s.Id
source share