I am using a model-first development approach with Entity Framework, meaning I make schema changes in a designer in Visual Studio, and use the Generate Database from Model command to generate a a SQL script for creating all of the appropriate database tables which match the model.
I am trying to figure out the best (any) approach to aut...
I'm trying to work out why memory usage in a basic application I'm writing is excessive. I'm trying to create a dynamic MVC sitemap with about 25000 nodes and populating it from a database table using the entity framework (though this detail is probably not important)
I have the following code:
foreach (var c in context.Companies) { }...
I think i am doing something wrong in here so i will paste here so you can put me to the right track:
public MembershipCreateStatus CreateUser(string username, string password, string mail, bool autoemail, string fullname)
{
using (TemplateEntities ctx = new TemplateEntities())
{
...
This is a general question on doing pagination with models containing multiple entity indexes. This is easier with an example so let us consider the example that Brett Slatkin provided in his video (http://www.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html).
You have your Message model (I have ignored the MessageIn...
I am using JPA (OpenJPA). I have following entries in my persistence.xml:
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
I also have Serviceoffering class listed in perisitence.xml.
I am getting following exception when I try to run my jpa related code. What can be the problem?
No metadata was found for type "c...
The following code retrieves all bytes data at once.
I'm wondering how to access byte data stored in chunk using entity framework. Since files are so big (around 50MB), I want to send it to user by chunks as soon as I get partial bytes from database.
using (Entities context = new Entities(EntitiesConnectionString))
{
byte[] data = ...
Hi there,
I was using Entity Framework and connectionstring becomes a big hassle. In unit test, i have to add the connectionstring, ddl put the connectionstring, etc, any place where i reference the biz library, i had to add the connectionstring. I thought it might be time to begin use Enterprise library's shared configuration section, ...
Hello All:
I have 3 tables
a. Employee (EmpID (pk), EmpName)
b. Department (DepID (pk), DepName)
c. EmployeeDepartmentMapping (ID (pk), EmpID(fk), DepID(fk))
When I am inserting new employee, I want to insert correspoding Emp-Dep mappings in the EmployeeDepartmentMapping table using entity framework 3.5. Can any body help/tell me ho...
Hi, I am using Spring + Hibernate to create and store a record in a MySQL database.
Just before persisting a record I want my system to generate a random-string which will be stored in a field in the entity that is being stored. This random-string of characters will be used later as an access-key to retreive the record and confirm the ...
I have been looking into Code First with Entity Framework CTP4 and you can use the ModelBuilder to build up your table columns. Is there a way to set the default value for a column in the database using the ModelBuilder or some other mechanism?
Thank You!
...
I have two tables in my entity framework, objects, and parameters which have a foreign key pointing to the object to which they belong. I want to populate a tree with all the attributes of a certain object. So in order to find those I want to do this:
String parentObject = "ParentObjectName";
var getAttributes = (from o in myDB....
I have a simple Core Data model:
Entity Team (name, logo)
Entity Sport (name, teams to->many Teams)
So, a Sport can have many Teams
I create the Team first, then add or edit a Sport and add the Teams.
If I delete a Team, my app starts crashing.
I believe because it is looking for the deleted reference.
So, how can I restrict via Core...
Hi,
I am using EF4, Microsoft.Entity.CTP, and the latest MOQ. I am trying to create a generic repository class and moq the DBContext using MOQ. Whenever I run my moq test I get "object reference not set to an instance of an object" on this.context.Set().Add(entity); and I don't understand why. The code runs ok without a moq.
public clas...
This might be something simple that I just keep missing but...
I can get the entity name but is there anyway to use an entity name assigned to a varible to have an Autocad command use the entity as the selected object to act on?
...