I have a stored procedure that returns multiple result sets. Each one is a complex type. The first result set would contain a list of items of the same complex type as the second result set, etc. These do not cleanly correlate to specific entities. Fo...
We are using ...Entity Framework 6.0.0... and use database first ...(like this)... to generate code from tables and stored procedures. This seems to work great, except that changes in stored procedures are not reflected when updating or refreshing the mo...
I am following along Pro ASP.NET MVC 4 by Adam Freeman on VS 2010 (I downloaded the MVC 4 template online). I have worked with the .edmx file before, but in Chapter 7 he does not do this. I setup a basic connection string with SQL Server in my web.config ...
After upgrading our project from using Entity Framework 5 to Entity Framework 6 (though NuGets update function) i get the following error on my generated Entities class:...Error 1 The type or namespace name 'Objects' does not exist in the namespace 'Sy...
I am trying EF6 and trying to utilize a many to many relationship....Using Database first here is my scripted out database....CREATE TABLE [States] (
Id int identity (1, 1) not null primary key,
Name varchar(50) not null,
Abbreviation varchar(...
Can i change entity framework database first auto generated classes (under .tt) to derive from a base class (BaseEntity)?...Some of my domain classes has two property (CreateDateTime & CreateUserId) and i want to set this properties automatically before S...
I'm new to EF and inherited a project that apparently used database-first development....The production environment uses SQL Azure and I'm basically trying to figure out the standard approach for updating its schema. ...At first, I tried enabling migratio...
I am trying to update record using EF6. First finding the record, if exists, update it.
Here is my code:-...var book = new Model.Book
{
BookNumber = _book.BookNumber,
BookName = _book.BookName,
BookTitle = _book.BookTitle,
};
using (var db =...
Let’s say in my EF6 project [Database-first approach] I have a complex type called ...Address... [just to clarify my complex type does not have any identity and is only a merge of aggregation of standalone data and it is not even responsible for its own...
I have a table with some relations, the program works fine until I add a new relation between this table and ...customer... table, the ddl for ...PermissionCode... Table (first table) is as below:...CREATE TABLE [dbo].[PermissionCode] (
[Id] int NOT NULL ...
This might sound repeated but I have gone through all the available posts but could not figure out the best method in EF 6 version....I have two tables...PersonPhone (PersonID, PhoneTypeID)
PhoneType(PhoneTypeID, Description)
...PhoneTypes as just look u...
I have a database that has a table with a 2-column primary composite key (one int, one bigint.) I have two tables that have a composite foreign key, referencing the first table's composite primary key. The relationships are (as far as I know,) fine and ...
We need to migrate an existing project from database-first to code-first. Each environment (DEV, TEST, PROD) has a slightly different version of the database. The differences are the changes in DEV that may not have been pushed to TEST and PROD....--...
I'm using EntityFramework 6.1.3, database-first. I am currently wishing I had chosen code-first......I have a database with some tables. I've previously
built my edmx off of these tables. Then I changed the type of a few columns and added a few columns. ...
For last couple of days I am searching for some tutorials about how to call a ...Stored Procedure... from inside a ...Web API... controller method using ...EntityFramework 7.......All tutorials I came through are showing it the other way round, i.e. ...Co...
I'm working with an existing database that has multiple schemas. In addition, different schemas duplicatate table names. Code First deployment is not an option....When generating my edmx, I'm hitting multiple issues, but the main one I'm concerned about...
I am working with ...EF6... and generating models (database-first) from multiple databases. Some databases have same table names so when model is generated they start conflicting. To solve ...namespace... problem I went to ...Model.tt... file properties i...
I am trying to create models using an existing SQL Server 2016 database. When the run the command prompt as shown in the documentation:...PM> Scaffold-DbContext "'Server=techestatevm.southeastasia.cloudapp.azure.com;Database=Blogging;User Id=newuser;Passw...
I am trying to retrieve a single row from my table using Entity Framework core. This seems to be very simple, but i cannot get it to work....I am able to get the list by using ..._context.COUNTRY.ToList();...This gives me the full list of countries in my ...
I am implementing a MVC-Webapplication with ASP.NET Core (RC2) and as ORM Entity Framework Core. Since I already got a database design, I have to create the entity models by the Scaffold-DBContext command....This works fine. Now, I want to add some annota...