I am re-writing this question to make it clearer what I need to do. I am trying to use Rhino-Mock to test:
public IQueryable<TxRxMode> GetAllModes()
{
return m_context.TxRxModes.Where(txRxMode => txRxMode.Active);
}
Here's the code:
var context = MockRepository.GenerateStub<IProjectContext>();
//Returns an empty ...
Hello
I have a field in a table which is declared as bigint, but Entity framework displays it as Int
This is causing me a problem because the model field is int32 but linq then tries to save as int64
If I change the field in the property to int64 I get type mismatch errors
Has anyone ever encountered this?
Paul
...
Hello
I have a stored procedure which returns a couple of fields from a table that has many fields
I need to get this into a custom type in my model
I have added my entity and changed the function import to return objects of the new type but now I get a problem where the columns are not mapped
Can anyone help?
Cheers
Paul
...
Here is the inner exception:
InnerException: System.Data.UpdateException
Message=Entities in 'OrganizerDBEntities.Assignments' participate in
the 'CourseId' relationship. 0 related 'Course' were found.
1 'Course' is expected.`
I have three tables (Folder, Assignment, Course). The Assignment table has a primary key called Assignm...
I am in the process of build a script for a fairly big project. One of the projects require an Entity Framework Model to be compiled into a library. Due to the way the build server works, all builds are hand crafted to manage the various deployment scenarios without affecting the developers and the project files.
Is there anyway to gene...
How do I create a new sql server session in entity framework?
Thanks~
...
Hello
I have this piece of code:
public string[] GetUsergroupRoles(string username)
{
var qry = from ug in _entities.Usergroups
from r in _entities.Roles
from u in _entities.Users
where u.Username == username
group r by
new
{
...
Hey all
I've been working around a problem I have when using LINQ to Entities when using closures.
Apparently, L2E does not support closures. Meaning:
var users = from user in UserRepository.FindAll()
select new UserDTO
{
UserId = user.UserId,
Tickets = from ticket in TicketReposit...
I constructed my Entity Model. One of my business objects,let's call it Store has a spatial data type. Very quickly I figured out that spatial fields aren't mapped via EF4. However I struggled my way out, by editing the xml declarations defining a query like the following:
<EntitySet Name="Stores" EntityType="Eltrun.OnShelfAuditModel....
I'm using Entity Framework with an AS.NET MVC application. I need to allow the user to create new records and modify existing ones. I am able to fetch existing records no problem, but when I pass back in the edited entity and try to save it it creates a new one and saves it and leaves the original unmodified.
I am getting the object fro...
Hello,
I'm investigating a method of providing transparent bi-temporal versioning of entities with Entity framework 3.5 or 4.0.
What I want to do:
When an entity is saved, the former entity has to be copied into a separate table, for example, if the entity is Customer, it will be saved in Customer_AUD.
Upon retrieval, based on date/ver...
We are developing a large scale business application using most new technologies through .NET 3.5 and we are using EF as DataAccessLayer in our architecture in addition to Transaction management which automatically uses System.Transaction and MSTC.
We need to deploy this application by ClickOnce method for over 300 end-user in each custo...
Does VistaDB support 'Update model from Database' feature in EF4? I'm receiving this message:
" ... 'System.ArgumentNullException' 'Value Cannot be Null'
Parameter name: providerInvariantName"
...
I have an Entity Framework model that was generated by the Visual Studio 2008 wizard based on a Sql Server 2008 database.
The model has a view that logically is joined in a many-to-many relationship with another table through a join table (enforced in the database by an insert/update trigger). Both tables and the view are part of the...
Hi All,
I am encountering a problem when I go to update an object in my database using Entity Framework.
Firstly, the concept is:
A user can be a member of a group, hence a Group contains Users.
To model this in the database, I have the following structure:
Users:
ID
Name
etc.
Groups:
ID
Name
GroupMembers: ...
I am creating software where user can create new product based on older product.
Now I need to make copying / cloning operations with Entity Framework. First I started writing like this:
foreach(sourcedata1 in table1)
{
... create new table
... copy data
... create Guid
... add
foreach(sourcedata2 in table2)
{
...
Is it possible to use "code only" with Entity Framework in an out-of-the box VS2010 Beta 2, or do I need some additional download?
...
I've got a deadline for an initial release of a client-server application that will have lots of iterative releases subsequently.
NHibernate is the ORM of choice, largely by reputation and my desire to gain experience with it.
The problem is that I haven't even had a chance to spike NHibernate yet, and I'm afraid that doing so is going...
I have a project where the client is using Entity Framework, and I'm trying to abstract away the generated classes from the rest of the application.
One generated class is Category and it has say Type as a property.
I've created an interface that I want Category to implement, like this:
public interface ICategory
{
string Type { g...
I have a LINQ query like this:
from i in _db.Items.OfType<Medium>()
from m in i.Modules
from p in m.Pages
where i != null && i.Type == 1 && i.Published == true && p.PageId == 2
select p
I use the query like this because I have strongly typed view (ASP.NET MVC).
I need to have items sorted by the i.Sort property. orderby i.Sort and i....