npgsql

How to use WebMatrix methods with Npgsql in .NET MVC Core 5

给你一囗甜甜゛ 提交于 2021-01-07 04:31:13
问题 I want to use WebMatrix.Data namespace #region Assembly WebMatrix.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 // .. \packages\Microsoft.AspNet.WebPages.Data.3.2.7\lib\net45\WebMatrix.Data.dll with Npgsql data provider in ASP MVC Core 5. In web.config it is defined as <system.data> <DbProviderFactories> <clear /> <add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql

【ABP.Net】2.多数据库支持&&初始化数据库

亡梦爱人 提交于 2021-01-02 05:09:20
abp默认连接的数据库是MSSQL,但是在开发过程中往往很多开发者不满足于mssql。 所以这里演示一下把mssql改成postgresql,来进行接下来的系统开发。 abp的orm是用EF的。那么我们就从ef动手。 首先我们先安装下面两个库 Install-Package Npgsql.EntityFrameworkCore.PostgreSQL -Version 2.2 Install-Package Npgsql.EntityFrameworkCore.PostgreSQL.Design -Version 1.1.1 顺带一提,如果想用mysql的话 Install-Package MySql.Data.EntityFrameworkCore -Version 8.0.15 安装完成之后,我们只要修改一下配置文件 把builder.UseSqlServer修改成UseNpgsql 然后修改Migrator层的根目录添加配置文件appsettings.json的连接字符串 下面是内容 { " ConnectionStrings " : { " Default " : " " //写入你的连接字符串 } } 将启动项设置成 运行。 键入Y 然后数据库就初始完毕了。期间报了一个错误,原因是创建初始化数据的时候,不为空的字段变成了空的。 我的解决方案是用ef

Could not load file or assembly 'System.Memory, Version=4.0.1.' in Visual Studio 2015

独自空忆成欢 提交于 2020-12-30 06:54:11
问题 For a couple of months i had no issue about generating the model from DB by deleting it and recreating it . After a pull from git, an issue has been occurred while trying to make the same process . After the second step (connection string creation with DB) there is no further proceed at the 3rd step and no connection string with the data base is being created at the app.config file.I have tried to test the connection with the database credentials and i am getting the following . When i try to

Could not load file or assembly 'System.Memory, Version=4.0.1.' in Visual Studio 2015

↘锁芯ラ 提交于 2020-12-30 06:53:05
问题 For a couple of months i had no issue about generating the model from DB by deleting it and recreating it . After a pull from git, an issue has been occurred while trying to make the same process . After the second step (connection string creation with DB) there is no further proceed at the 3rd step and no connection string with the data base is being created at the app.config file.I have tried to test the connection with the database credentials and i am getting the following . When i try to

Entity Framework Core postgresql Array Type Mapping not working

夙愿已清 提交于 2020-12-06 12:37:48
问题 I have a strange problem, maybe it is something that I'm missing out, but I have the following LINQ Lambda query: var ss = ctx.ShipZones.SelectMany( z => ctx.ShipDecks, (z, d) => new { Zone = z.ZIndex, Deck = d.DIndex, Value = ctx.Tags .AsExpandable() .Include(s => s.TagSettings.Device.System) .Where(s => s.TagSettings.TagTypeId == 171 && s.TagSettings.Device.System.Id == z.Id && s.TagSettings.Device.ControlArea.Contains(d.Id) ) .Average(s => s.Value) } ).ToList(); According to this article,