Răsfoiți Sursa

Let's be modern

Piotr Czajkowski 6 luni în urmă
părinte
comite
4da14620d7

+ 2 - 2
ExcelORM/ExcelORM/ExcelORM.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
     <PropertyGroup>
-        <TargetFramework>net7.0</TargetFramework>
+        <TargetFramework>net8.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
         <Nullable>enable</Nullable>
         <Version>2.2.0</Version>
@@ -14,7 +14,7 @@
 	<Authors>Piotr Czajkowski</Authors>
 	<Description>Simple library to read/write C# objects from/to Excel files. </Description>
 	<RepositoryType>GitHub</RepositoryType>
-	<PackageReleaseNotes>Added Skip attribute.</PackageReleaseNotes>
+	<PackageReleaseNotes>Using .NET 8 now. Added support for formulas. Got rid of new constraint.</PackageReleaseNotes>
     </PropertyGroup>
 
     <ItemGroup>

+ 2 - 4
ExcelORM/ExcelORM/ExcelReader.cs

@@ -1,4 +1,4 @@
-using System.Runtime.Serialization;
+using System.Runtime.CompilerServices;
 using ClosedXML.Excel;
 using ExcelORM.Models;
 
@@ -21,9 +21,7 @@ public class ExcelReader
         foreach (var row in rows)
         {
             if (SkipHidden && row.IsHidden) continue;
-
-            var current = FormatterServices.GetUninitializedObject(typeof(T)) as T;
-            if (current == null) continue;
+            if (RuntimeHelpers.GetUninitializedObject(typeof(T)) is not T current) continue;
 
             foreach (var item in mapping)
             {

+ 1 - 1
ExcelORM/ExcelORMTests/ExcelORMTests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
     <PropertyGroup>
-        <TargetFramework>net7.0</TargetFramework>
+        <TargetFramework>net8.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
         <Nullable>enable</Nullable>