zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

11 results in tag: sql-server-2012

Creating indexes with Entity Framework 6 Migrations

Is there a way to create an index in MS SQL Server database using Entity Framework Code First Migrations, if the index has to be: ...descending by at least one column...including other columns...?...It has to produce something like this:...CREATE NONCLUST...
ef-code-first entity-framework entity-framework-6 indexing sql-server-2012
asked by Michael Sagalovich

How do I use spatials to search a radius of zip codes?

Background...I'm writing an application which finds events within a certain radius of a zip code. You can think of this like ticketmaster, where you type in your zip code and all of the concerts in the radius of x show up....I have a database table which ...
c# entity-framework entity-framework-6 sql-server-2012
asked by Steve's a D

What is the difference between ExecuteSqlCommand vs SqlQuery ? when doing a db access?

I have had a couple of suggestions on how to access data from my database:...var allMyIds = context.Database.ExecuteSqlCommand("select id from AspNetUserLogins"); var allMyIds = context.Database.SqlQuery<string>("select id from AspNetUserLogins")...
asp.net c# entity-framework entity-framework-6 sql-server-2012
asked by Samantha J T Star

Entity Framework: how to find transaction isolation level in SQL Profiler?

BeginTransaction... method is used to manage transactions in Entity Framework 6. It allows to set isolation level for transaction as you may see in code below (just a sample):...using (var context = new DataContext()) { using (var transaction = contex...
entity-framework entity-framework-6 sql-server sql-server-2012 transactions
asked by Ilya Chumakov

Convert 'string' to 'int' in an .Any() LINQ query

I have a conditional statement that evaluates an ....Any()... LINQ query against my DB....It is throwing an error when casting/converting a string to long value....(long.TryParse(m.Reference,out t)? t : long.MaxValue) ...The error is something like:...LIN...
c# entity-framework entity-framework-6 linq sql-server-2012
asked by Mark

EF 6.x and function with table-valued parameter

I have a DB function requiring a table-valued parameter as argument (@c)....CREATE TABLE Test ( CD varchar(10) not null ) GO INSERT INTO Test VALUES ('TEST') GO CREATE TYPE [CdTable] AS TABLE (CD varchar(10)); GO CREATE FUNCTION TestTbl ( @x varcha...
c# entity-framework entity-framework-6 sql-server sql-server-2012
asked by zpul

"A dependent property in a ReferentialConstraint is mapped to a store-generated column." on a persisted computed column (EntityFramework DB first)

I've implemented a simulated table inheritance construct in my SQL-Server based on the article ...Implementing Table Inheritance in SQL Server.... ...Besides the fact to use simple 1 to 0...1 relationships you create another constraint to a type table tha...
asp.net c# entity-framework entity-framework-6 sql-server-2012
asked by Martin Braun

LINQ Group By method not generating the expected SQL

Following LINQ query is supposed to return number of logins per user:...Controller...:...var lst = _context.LoginHistory.GroupBy(l => l.UserName).Select(lg => new { user_name = lg.Key, cnt = lg.Count() }); return View(lst.ToList()); ...But the ...SQL Pr...
asp.net-core-1.1 c# entity-framework-core linq-to-entities sql-server-2012
asked by nam

EF Code First Migrations and Foreign Key Constraints

Once FK Constraints have been created via Entity ...Framework Core 1.1 with Migrations... in an ASP.NET Core ...Code First... app, would it be ok to temporarily enable/disable the constraints directly in SQL Server without using EF - would it break the mi...
asp.net-core entity-framework entity-framework-core sql-server sql-server-2012
asked by nam

Entity Framework Core 2.0 Many to Many Inserts before primary key is generated

I'm trying to create an entity object that has many to many relationships with other entities. The relationships are indicated as follows....public class Change { // Change Form Fields [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity...
asp.net-core-2.0 asp.net-core-webapi c# entity-framework-core sql-server-2012
asked by David

SQL Server - Validate Column In Every Insert

I am writing a .net core 2.2 C#, code-first, api with a SQL Server backend. It was just requested to make the api a multi-tenant api. So, I added TenantId (INT NOT NULL) to all DB tables, QueryFilters, etc... Everything is working as expected....I want to...
c# entity-framework-core sql-server-2012
asked by Ben

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!