1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-23 17:07:42 +01:00

TVP type name

This commit is contained in:
Kyle Spearrin 2017-08-09 08:14:45 -04:00
parent 7590ea37f9
commit 503370d059

View File

@ -57,8 +57,9 @@ namespace Bit.Core.Utilities
public static DataTable ToArrayTVP<T>(this IEnumerable<T> values, string columnName)
{
var table = new DataTable($"{columnName}Array", "dbo");
var table = new DataTable();
table.Columns.Add(columnName, typeof(T));
table.ExtendedProperties["dapper:TypeName"] = $"[dbo].[{columnName}Array]";
if(values != null)
{
@ -73,7 +74,8 @@ namespace Bit.Core.Utilities
public static DataTable ToArrayTVP(this IEnumerable<SelectionReadOnly> values)
{
var table = new DataTable("SelectionReadOnlyArray", "dbo");
var table = new DataTable();
table.ExtendedProperties["dapper:TypeName"] = "[dbo].[SelectionReadOnlyArray]";
var idColumn = new DataColumn("Id", typeof(Guid));
table.Columns.Add(idColumn);