PlanTempusApp/Tests/UnitTest1.cs
Janus Knudsen 269bf50c78 Adds code
2025-01-03 20:21:44 +01:00

23 lines
No EOL
652 B
C#

using Autofac;
using System.Data;
using Insight.Database;
namespace Tests
{
[TestClass]
public class UnitTest1 : TestFixture
{
[TestMethod]
public void MyTestMethod()
{
var conn = Container.Resolve<IDbConnection>();
//https://www.reddit.com/r/dotnet/comments/6wdoyn/how_to_properly_register_dapper_on_net_core_2_di/
//https://www.code4it.dev/blog/postgres-crud-dapper/
//https://stackoverflow.com/questions/69169247/how-to-create-idbconnection-factory-using-autofac-for-dapper
conn.ExecuteSql("SELECT 1 as p");
var sql = "SELECT * FROM public.Foo";
var customers = conn.Query(sql, commandType:CommandType.Text);
}
}
}