score:1
For #1, There is no way, to work with schemas directly in a Linq-To-Entities query. I believe they are adding some functionality here in EF6, but I'm guessing you don't want to wait until then.
There is one work around, which I have used in SQL Server 2008, using Synonyms
(I believe PostgreSQL also has Synonym
functionality).
For example, if your table names are dbo.Address
and read.Address
, you would create a Synonym
for read.Address
, named read.Address_read
, then you would add the Synonym
to your EF datamodel, instead of the table itself. This gives you the ability to perform any and all queries against multiple schemas at once, because EF thinks these tables have different names.
Source: stackoverflow.com
Related Query
- Linq and Entity Migrations with specific schemas in PostgreSQL
- How to avoid memory overflow when querying large datasets with Entity Framework and LINQ
- Entity Framework - Linq query with order by and group by
- Use a Inline Table-Valued Functions with Linq and Entity Framework Core
- Trouble with Entity Framework Linq Query: runs instantly in SSMS and 8-10s in EF LINQ
- Getting stored procedure output parameter with LINQ and Entity Framework
- Add leading zeros with LINQ and Entity Framework
- SELECT NEW with a potentially null field using LINQ and Entity Framework
- Group items and select specific item from each group with LINQ
- Nested expression building with linq and Entity Framework
- How to query many-to-many relationship with 'AND' condition using LINQ and Entity Framework
- Grouping by range of values with linq and entity framework
- GPS coordinates with Entity framework and LINQ
- C# - Linq optimize code with List and Where clause
- Timeout issue with PostgreSQL and Entity Framework
- Stubbing Code for Test With Linq Expressions and Lambdas
- LINQ: Translating a SQL WITH clause to LINQ and Entity Framework
- Entity Framework: How to perform left join with EF and LINQ among multiple tables
- create appropriate model with linq and entity framework
- Combine Two Properties From Entity In List And Flatten It With Linq
- SQL subquery result in LINQ and Entity Framework Code First
- Using Linq to query Entity Framework with Where clause and many-to-many relation
- Dynamic Order By On Date With Entity Framework and Linq
- Linq to SQL Group by and sum in select with entity
- most efficient Entity Framework Code First method of flattening / projecting parent entity with specific child
- Linq : Select multiple values and assign to select with specific option/value
- entity framework with linq query and stored expression error
- Compare DateTime in Sqlite with Entity and Linq
- Can I limit how many levels the .include adds with LINQ and Entity Framework 5?
- "Cannot add an entity that already exists" while deleting and recreating record with LINQ
More Query from same tag
- search the results by date
- Is there a way to ONLY add tables to an edmx file?
- Which explicit type did I get back from Enumerable.Select
- Don't take last record in linq C#
- IN Clause from an included table, doesn't works as expected
- Linq join on multpile columns with a where not equals condition and need to return columns from both tables
- get property lambda from property Name (Where property type can be nullable)
- Converting an advanced query from SQL to LINQ
- How to alter a single property when fetching a set of objects with EF?
- Unable to create a constant value of type 'WebApplication13.Models.Service'. Only primitive types or enumeration types are supported in this context
- Concatenate string property of a custom object from json array
- Mongo c# Driver Query (Select subfields)
- Select one table column with distinct record with other table all data
- c# linq if item is in list and get matching items from list
- DataContext. Is there a single method where I can add an extra WHERE?
- How do I write SELECT FROM myTable WHERE id IN (SELECT...) in Linq?
- Create an array of items in a Select
- Simplifying two LINQ queries with joins and grouping
- Entity framework LINQ with value OR null
- LINQ Compare TimeSpan
- Fetching items which has a specific set of child elements (advanced query - possible?)
- Is this correct way to Parse inner element of XML by LINQ in C#
- LINQ Distinct not working as expected
- How to configure foreach loop properly to avoid index out of range error?
- C# GroupBy in query
- Can't get right query result that I need
- Using a linq or lambda expression in C# return a collection plus a single value
- give type to anonymous type in linq query
- How do I overcome an "Unable to create a constant value of type ..." exception for a simple WHERE statement
- Both ISNULL and YEAR SQL functions in in Linq