I have a SQL Server 2008 database table that uses uniqueidentifier as a primary key. On inserts, the key is generated on the database side using the newid() function....This works fine with ADO.NET. But when I set up this table as an entity in an Entity F...
Is there any way to implement the Guid COMB identity strategy for objects in the new Entity Framework 4.1 using the CodeFirst design? I thought setting the ...StoreGeneratedPattern... would work, but it still gives me normal GUIDs.
I have an application that uses GUID as the Primary Key in almost all tables and I have read that there are issues about performance when using GUID as Primary Key. Honestly, I haven't seen any problem, but I'm about to start a new application and I still...
I am coming from a nhibernate background and I am wondering how can I generate the Guid automatically on the serer side and not make a round trip to make it on the database side?...In fluent nhibernate it is simple just... Id(x => x.Id).GeneratedBy.Guid...
Entity Framework 6 appears to default to ...sequential... GUIDs instead of completely random ones. How do I turn this off?...See CodePlex work item: ...http://entityframework.codeplex.com/workitem/71
I'm writing an Entity Framework LINQ query in which I want to parse a string into a UNIQUEIDENTIFIER (aka GUID) as part of the ...WHERE... clause:...public IEnumerable<User> Find(Guid guid)
{
return dbContext
.Users
.Where(user => Guid...
I'm using below code to fetch latest inserted record:...public Request GetLastRequest()
{
return _request.Find(_request.Max(p => p.Id));
}
...As you can see ...Id... is type of ...Guid...:...public class Request
{
public Request()
{
...
I have a case where I need to add a Guid Property that is NOT the primary key, and that could be shared with several objects in the table....What I'd like to do is:...Generate the Guid on the database when I don't give it a value...Set a Guid (instead of ...
I have this table:...CREATE TABLE [dbo].[SandTable](
[Id] [uniqueidentifier] NOT NULL,
[Date] [date] NULL,
CONSTRAINT [PK_SandTable] PRIMARY KEY)
ALTER TABLE [dbo].[SandTable] ADD CONSTRAINT [DF_SandTable_Id] DEFAULT (NEWID(...
I am having problems with my MSSQL database design....I had 2 tables that looked like this:...CREATE TABLE tenants
(
tenantId INT PRIMARY KEY,
tenantName VARCHAR
)
CREATE TABLE users
(
userId INT PRIMARY KEY,
userName VARCHAR,
tenan...