Hi, I'm having a ridiculous little problem.
I have generated my model classes in visual C# Express 2010 but in a 1(parent)->Many(children) relation I can only access the children through a vector in the parent. I want to also be able to access the parent through a child.
Does anyone know if this is a setting problem with a simple check...
Suppose I have a table like:
Person(ID, Name, DOB, ...)
I use EF to create model with VS2010. Then I want to use SP for CRUD. say my SP for insert like:
Create PROCEDURE [dbo].[Person_Add]
(@DOB datetime, @NAME varchar(10)= null,@PersonType as int)
AS
Begin
...
End
Param @PersonType is someting I want to use in SP for som...
This may be a really dumb question but I figure why not...
I am using RIA Services with Entity Framework as the back end. I have some places in my app where I accept user input and directly ask RIA Services (and in turn EF and in turn my database) questions using their data. Do any of these layers help prevent security issues or should ...
Hi,
I'm currently building a web based system and trying to implement N-Tier Entity Framework 4.0 with DTOs in a SOA Architecture. I am having a problem understanding how I should implement the Data Access Layer (DAL) , the Business Logic Layer (BLL) and the Presentation Layer.
Let’s suppose that I have a “useraccount” entity has the ...
Hey, I made several tables and relationships using SQL server manager. I then imported them to visual studio and it all appeared in the correct form, except one of the relationships did not appear. I have checked everything I could think of and it is the exact same as the other relationships. If you know anything I can check, I would app...
Hi,
I'm a newbie to ADO.Net Entity framework 4. I have a set of pocos which I need to map to a legacy database. The problem is that the db field names are different to the poco property names. eg. db field name = 'cusID' and poco property = 'CustomerID'.
What is the best way to map these?
...
I am using the ADO.Net Entity Model. Everytime I create a record, I am calling _entity.AddToTable(object); _entity.SaveChanges();
What is the fastest way of inserting the data? Is there any "batch" or "SqlBulkCopy" option for entity model?
...
Hello,
I'm trying to use formview in order to do insert of a new entity object (called Customer)
Customer has a reference to another entity called Address.
How can I fill both of them in the same formview?
Thanks.
...
Hi,
I've been trying to fix this issue I get when I add a new entity framework edmx file to my project and try to make it generate my tables, procs and views. When I build it it gives me this error on my drawer table:
Error 601 Error 6017: The NavigationProperty 'Drawer' on the type 'DrawerCompany' is the source of a generated proper...
I'm investigating the use of Entity Framework in an upcoming project, but I have some concerns about the maturity and market adoption of the product. Are there any high profile web sites or applications using the product? Are there any significant open source projects that have picked it up?
...
Hi all
I am using a POCO class name "Company" generate from the T4 POCO code generator to create a derived class - name "CompanyBO" by "public class CompanyBO:Company", but when i call addObject method:
public void Delete(T entity)
{
CustomerWebPortalEntities entities = new CustomerWebPortalEntities();
...
With EF4 comes a new feature "Include foreign key columns in the model". What was the motivation behind adding this feature, and are there any particular gotcha's with either leaving it off, or turning it on when generating a model from an exisiting database?
...
I have a requirement to track what authenticated users change with regards to the data when logged in. I don't need to track what pages they look at although that could be very useful in future.
I have thought about saving the User Guid but that seems very clunky. I do need to do simple stuff like old value and new value. I am using the...
Hi,
I am porting an existing application from Linq to SQL to Entity Framework 4 (default code generation).
One difference I noticed between the two is that a foreign key property are not updated when resetting the object reference. Now I need to decide how to deal with this.
For example supposing you have two entity types, Company and...
I'm trying to run through this msdn article:
http://msdn.microsoft.com/en-us/library/dd723645.aspx
One of the steps is:
In the class file for the page, change the base class from UserControl to EntityTemplateUserControl.
Nowhere is it made clear what page is being referenced. Can someone help me? I don't see any relevant class in t...
Hey all,
I'm trying to update a detached entity in .NET 4 EF:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Save(Developer developer)
{
developer.UpdateDate = DateTime.Now;
if (developer.DeveloperID == 0)
{//inserting new developer.
DataContext.DeveloperData.Insert...
Hi,
I have a generic repository that uses the entity framework to manipulate the database.
The original code is credited to Morshed Anwar's post on CodeProject. I've taken his code and modified is slightly to fit my needs.
Unfortunately I'm unable to call an Imported Function because the function is only recognized for my specific ins...
To clearify: I use the POCO generator so that the entities are not tightly bound to the EF implementation.
In my entities, I tend to add comments for the properties but as I update the model and save it, all the comments are removed.
How can I prevent this behavior?
...
I have come across what appears to be very peculiar behaviour using entity framework 4.0.
I have a User entity, which has a Company (A Company has many Users).
If I do this, everything works as expected and I get a nice shiny new user in the database:
var company = _model.Companies.First();
company.Users.Add(new User(1, "John", "Smith...
In my query I need to return instances of a class that doesn't have a default constructor (specifically this is in a custom Membership provider, and MembershipUser is the culprit)
var users = from l in context.Logins
select new MembershipUser(
Name,
l.Username, // username
l.Id, // provider key
l.Mail...