diff --git a/build/GlobalAssemblyInfo.cs b/build/GlobalAssemblyInfo.cs index 9eccaee..c0442b2 100644 --- a/build/GlobalAssemblyInfo.cs +++ b/build/GlobalAssemblyInfo.cs @@ -19,4 +19,4 @@ using System.Runtime.InteropServices; [assembly: AssemblyVersion("2.2.0")] [assembly: AssemblyFileVersion("2.2.0.0")] -[assembly: AssemblyInformationalVersion("2.2.0-preview5")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("2.2.0")] \ No newline at end of file diff --git a/test/EFCore.Jet.Integration.Test/EFCore.Jet.Integration.Test.csproj b/test/EFCore.Jet.Integration.Test/EFCore.Jet.Integration.Test.csproj index 72d39fe..7fc91a4 100644 --- a/test/EFCore.Jet.Integration.Test/EFCore.Jet.Integration.Test.csproj +++ b/test/EFCore.Jet.Integration.Test/EFCore.Jet.Integration.Test.csproj @@ -251,6 +251,10 @@ + + + + diff --git a/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Context.cs b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Context.cs new file mode 100644 index 0000000..533f918 --- /dev/null +++ b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Context.cs @@ -0,0 +1,18 @@ +using System.Data.Common; +using Microsoft.EntityFrameworkCore; + + +namespace EFCore.Jet.Integration.Test.Model79_CantSaveDecimalValue +{ + public class Context : DbContext + { + + public Context(DbConnection connection) : + base(TestBase.GetContextOptions(connection)) + { + TestBase.TryCreateTables(this); + } + + public DbSet Table { get; set; } + } +} \ No newline at end of file diff --git a/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/JetTest.cs b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/JetTest.cs new file mode 100644 index 0000000..2ff284e --- /dev/null +++ b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/JetTest.cs @@ -0,0 +1,24 @@ +using System; +using System.Data.Common; +using System.Data.Jet; +using System.Data.OleDb; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace EFCore.Jet.Integration.Test.Model79_CantSaveDecimalValue +{ + [TestClass] + public class Model79_CantSaveDecimalValue : Test + { + protected override DbConnection GetConnection() + { + // ReSharper disable once CollectionNeverUpdated.Local + + OleDbConnectionStringBuilder oleDbConnectionStringBuilder = new OleDbConnectionStringBuilder(); + //oleDbConnectionStringBuilder.Provider = "Microsoft.Jet.OLEDB.4.0"; + //oleDbConnectionStringBuilder.DataSource = @".\Empty.mdb"; + oleDbConnectionStringBuilder.Provider = "Microsoft.ACE.OLEDB.15.0"; + oleDbConnectionStringBuilder.DataSource = Helpers.GetTestDirectory() + "\\BrandNewDatabase.accdb"; + return new JetConnection(oleDbConnectionStringBuilder.ToString()); + } + } +} diff --git a/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Table.cs b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Table.cs new file mode 100644 index 0000000..5c24505 --- /dev/null +++ b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Table.cs @@ -0,0 +1,8 @@ +namespace EFCore.Jet.Integration.Test.Model79_CantSaveDecimalValue +{ + public class Table + { + public int Id { get; set; } + public decimal DecimalValue { get; set; } + } +} \ No newline at end of file diff --git a/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Test.cs b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Test.cs new file mode 100644 index 0000000..55b6277 --- /dev/null +++ b/test/EFCore.Jet.Integration.Test/Model79_CantSaveDecimalValue/Test.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace EFCore.Jet.Integration.Test.Model79_CantSaveDecimalValue +{ + public abstract class Test + { + + protected abstract DbConnection GetConnection(); + + + [TestMethod] + public void Model79_CantSaveDecimalValue() + { + + using (DbConnection connection = GetConnection()) + { + using (var context = new Context(connection)) + { + var t = new Table(); + context.Table.Add(t); + t.DecimalValue = 1.23M; + context.SaveChanges(); + } + } + + + } + } +}