没有新的ASP.NET身份表为什么要停止使用的Guid(唯一标识符型)的钥匙? [英] Why did the new ASP.NET Identity tables stop using Guid (uniqueidentifier type) as keys?

查看:156
本文介绍了没有新的ASP.NET身份表为什么要停止使用的Guid(唯一标识符型)的钥匙?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解为什么新的ASP.NET身份表停止使用的Guid (唯一标识符型)作为键 - 相反,它现在使用为nvarchar(128),但仍然保持了的Guid 字符串 ...

I'm trying to understand why the new ASP.NET Identity tables stopped using Guid (uniqueidentifier type) as keys - instead it is now using nvarchar(128) but still keep a Guid as a string...

这难道不是一种巨大的浪费? (唯一标识符仅有2 的整数 VS全的Guid 作为一个36字符字符串

Isn't it a huge waste? (uniqueidentifier is just 2 integers vs the whole Guid as a 36 character string)

我怀疑实体框架可能是负责这...

I'm suspecting that Entity Framework might be responsible for this...

它是安全的变回UNIQUEIDENTIFIER键?

Is it safe to change back to uniqueidentifier keys?

谁能告诉我什么是使用36字符串的好处是什么?

Can anyone tell me what are the benefits of using 36 character strings?

推荐答案

身份是建立在多个存储平台工作,不是每一个存储平台已经GUID作为支持的存储类型。

Identity is built to work on multiple storage platforms and not every storage platform has Guid as a supported storage type.

您可以更改默认的字符串p键进入的Guid,但涉及到你的C#模型的一些工作。或者,你可以改变p键为一个int - 任何你喜欢的。要知道,有关于的辩论 = http://blogs.msdn.com/b/sqlserverfaq/archive/2010/05/27/guid-vs-int-debate.aspx相对=nofollow>这是的better

You can change the default string pkey into Guid, but that involves some work on your C# models. Or you can change the pkey into an int - whatever you like. Just be aware that there is a huge debate about which is better.

这篇关于没有新的ASP.NET身份表为什么要停止使用的Guid(唯一标识符型)的钥匙?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆