Click here to Skip to main content
15,889,403 members
Everything / Entity foundation

Entity foundation

entity-foundation

Great Reads

by Todd Christell, Canin Christell
Creating a Microwave Oven IoT Application

Latest Articles

by Todd Christell, Canin Christell
Creating a Microwave Oven IoT Application

All Articles

Sort by Score

Entity foundation 

16 Dec 2014 by TheRealSteveJudge
You must add the Entity Framework to your solution.Tools -> NuGet Package Manager -> Manage NuGet Packages for solution.In Search Online enter "Entity Framework"
8 Mar 2015 by Member 11428137
You just need to make the foreign key name match the navigation property.In the foreign key, you have used "Route", and the navigation property is "route"So change this:[Key, ForeignKey("Route")]to this:[Key, ForeignKey("route")]And you should be sorted.
29 Dec 2018 by Dave Kreskowiak
Simple. You don't. If there's no primary key, Entity Framework can't use the table. EF MUST have a way to uniquely identify every record in the table, and that means having primary keys. Really, you don't even want to work with "tables" that don't have keys without some ORM. It can be an...
14 Jul 2014 by habib_namvar
hi excuse me i can not type English very goodi want to use entity in run timefor example var q=db.news.where(here fill in run time ).tolist();
14 Jul 2014 by ArunRajendra
Not sure. Migth be this will help you.http://stackoverflow.com/questions/14621450/dynamic-where-clause-or-in-linq-to-entities[^]http://stackoverflow.com/questions/20054742/entity-framework-dynamic-query-with-or-conditions[^]
14 Jul 2014 by habib_namvar
for example i have a query like thisvar q=db.news.where(p=>p.id==3).tolist();and another time i shuold have a query like thisvar q=db.news.where(p=>p.id==3 || p.id=10).tolist();and ...i wanna use run time in conditionor another sample i wanna get condition from user
22 Jul 2014 by Suvabrata Roy
My questions are:- Can I derive an entity from the customer entity orYes you can but in edmx you need to manually write the code in designer.cs.- should I keep every property in the customer entityWhen you inherit the child class became the supper set of base class you can...
2 Sep 2014 by binoyvijayan
hi all,I am working on a class file that uses entity framework 6, I have two object files roles.cs and task.cs role.cs is likepublic partial class Role { public Role() { this.Tasks = new HashSet(); ...
2 Sep 2014 by binoyvijayan
hi all,I am working on a class file that uses entity framework 6, I have two object files roles.cs and task.cs role.cs is like public partial class Role { public Role() { this.Tasks = new HashSet(); this.Users =...
2 Sep 2014 by Adam Jones
try adding the role Id to the task classpublic partial class Task { public Task() { this.Users_Tasks = new HashSet(); this.Roles = new HashSet(); } public int TaskID { get; set; } public string TaskName...
2 Sep 2014 by binoyvijayan
hi all,Got solution we can add it like this var role = db.Roles.Where(r => r.RoleID == roleId).First(); role.Tasks.Add(db.Tasks.First(c => c.TaskID == taskId)); db.SaveChanges();
12 Oct 2014 by Suraj Sahoo | Coding Passion
Please check this link for help, explained quite nicely..Crud using Typescript & knockout[^]Hope this helpsThanks:)
16 Oct 2014 by Sinisa Hajnal
The answer is very simple. You can't. Because of the web inherent parallel access you cannot query the next ID and then count on it being available at the time of the saving data.What you can do however is query additional table COUNTERS in which you will keep current last saved item and...
7 Nov 2014 by Nathan Minier
This is because you need to create a context object for your data that will inherit from DbContext and add any needed connection details into your web.config. Alternatively, you can create a controller as a class instead and use non-EF data access.If you want to use EF:public class...
6 Nov 2014 by ankit.agg1984
Hello,How to resolve "Unable To retrieve metadata for MVCApplication.Models.StudentList.The specified named connection is either not found in the configuration, not intended to be used with the EntiyClient provider, or not valid" during add controller in c# asp.net mvc 4?I cant add...
13 Nov 2014 by brombenzol123
Trying MVC on simple examples I've faced a problem with creating templated controller with reading and writing and views using Entity Framework.I choose model class Album.cspublic class Album{ public int AlbumId { get; set; } public int GenreId { get; set; } public int...
3 Dec 2014 by BallaviKrishna
List obj = datacontext.tblAdverts .Where(i => i.BusinessUserId == id) .GroupBy(i => i.Plans) .Select(i => i.Key.Value).ToList();
3 Dec 2014 by DamithSL
you are selecting from group by results, Key means here based on what you have done the grouping. ( here Plans), so you selecting Plans.Value property of each group results. Here value may be a property or if it is a Nullable type then most probable it is Nullable.Value Property [^]
16 Dec 2014 by Sergey Alexandrovich Kryukov
"Using" has nothing to do with adding references. It is related to namespaces, which is a very different thing, and is merely a way to shorten down fully-qualified type names, by omitting the namespace part from them, fully or partially. You could just use full type name instead. Adding "using"...
5 Jan 2015 by rudolph098
please i need your help, i am very new to MVC and i am trying to make a CreateEmployee form in MVC. for now, all i am trying to achieve is to add the poulated dropdownlist for Departments to the form. the dropdownlist is populated from a database , and using visual studio, i connected to the db...
5 Jan 2015 by rudolph098
add the following to the model.public int Department { get; set; }public IEnumerable Departments { get; set; }add the following to the controllerpublic ActionResult CreateEmployee() { using (var db = new DepartmentDbContext()) { var model = new...
12 Feb 2015 by Dj@y
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient' i got this error when i try run application on iis,but it's run in VS2013
13 Feb 2015 by Rahul Rajat Singh
It seems the entity framework package mismatch. Another problem could be that the .config file is missing some essential configuration paramters. The easiest way to fix this would be to reinstall the nuget package if entity framework (desired version). This will fix the version mismatch problem...
21 Feb 2015 by Member 10225052
I want a one-to-one relationship, between route and difficult level(simple, hard)I have these models: public class Route { [Key] public int routeID { get; set; } public string Name { get; set; } public int? UserProfileID...
24 Aug 2017 by Afzaal Ahmad Zeeshan
I am unsure as to what is the problem here, ASP.NET and Entity Framework are just the tools for building this kind of service, and the level of complexity depends on what you want to build a search engine around. You can have a personal website search engine, a network search engine and just...
29 Dec 2018 by ahmed_sa
Problem How to use entity framework with database tables that not have primary key. i have old database made by SQL server 2012 i get requirement to work as entity framework technique and mvc . i suddenly found that more tables not have primary keys and no relation ship between some tables...
25 Feb 2015 by Todd Christell, Canin Christell
4 Dec 2014 by BillWoodruff
List obj = datacontext.tblAdverts// build Collection#1: create a collection of all entries in tblAdverts where the entry's BusinessUserId matches the value of the variable 'id.Where(i => i.BusinessUserId == id)// build Collection#2: analyze Collection#1 to build a Collection of...
11 Aug 2014 by Sreejesh T J Nair
for with you can use var datas=(from d in entityObj.GetDataFunction into somename select new{somename.ID,Somename.Name....});and for Unionvar data1=entityObj.GetFirstData.Select(x=>new DataDto{x.Id,....});var data2=entityObj.GetSeconddata().Select(x=>new...
22 Jul 2014 by Jeroen E
Hello,I'm creating a model in the entity framework 6.0.I have an abstract entity Person.From this abstract entity I have a derived type customer.So far common practice.Now i want to derive an entity from the customer entity, because the model is for multiple companies, each one...
15 Oct 2014 by KP Singh Chundawat
I am using an Entity Framework 5 connection to connect to a SQL 2008 server to do database handling for my application.I am using MVC4 in Visual Studio 2013 and my question is regarding Primary Key fields that are incremented by the SQL itself, is it possible at all for me to be able to find...
22 Jul 2014 by Nipesh Shah
As per my understanding to your question, I think yes, this can be done by code but not sure whether by EDMX or not. Also this is the best way of using inheritance, and reduce redundant code.In C# you can use any class as Base, but a class can have a single base. So you can use as like below...
3 Dec 2014 by Suraj Sahoo | Coding Passion
This is called LINQ(Language Integrated Queries), with the help of which which at the back end this gets converted to normal Sql queries which you can also check using a very nice tool called LINQPAD[^]Here in this statement you have mentioned, this query returns a list of integers from the...
12 Oct 2014 by jitendra prajapat
Hello All Experts This is challenge to all .net Experts I need CRUD operations in MVC4 with TypeScripts with KnockoutJS please give me quick response Thanks in advanced.Jitendra
2 Oct 2020 by raxhemanth
the type or namespace name DbContext could not be found( are you missing a user directive or assembly reference?) Why?but i added the reference using- using System.Data.Entity; && System.Data; Namespacesbut still getting the same when working with entity framework why?What i have...
6 Mar 2017 by Ramkrishan Patil
When I am trying to add dataset in rdlc report of my existing project then then shows this error. in details of that error msgObject reference not set to an instance of an object.I am using Entity Frame work structure in asp.net with C#
3 Dec 2014 by Praveen Kumar Upadhyay
Select will return the object(List) which is specified the LINQ condition.
16 Mar 2015 by Dj@y
I am developing one application in .net4.5 and have entity framework 6.0 but speed is not good for retrieving data and showing it. so how can i increase the speed of application.
16 Mar 2015 by Pankil Bhatt
If you have Nuget,add the .dll RequestReduce, RequestReduce.SqlServer and RequestReduce.SassLessCoffeeanother option:enter this command in the Package Manager ConsoleBasic RequestReduce Features:PM> Install-Package RequestReduce RequestReduce Features with Sql Server Web Farm...
6 Oct 2015 by Member 12030170
You should add the below code in the model :public int ID { get; set; }// below given an example :public class Example{public int ID { get; set; } // this code ID helps to retrieve meta data.. And connecting to databasepublic string Name { get; set;}}// or try public...
13 Nov 2022 by Keshav Mooruth
I am working on a C# E-Commerce application. I having difficulties deleting and adding a item to the cart. It gives me the error in the price column which is a decimal field. The application only executes the delete/add to cart when I change...