Skip to content

Commit

Permalink
fix: avoid to modify when autodetect changes was enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarmesquita committed Sep 4, 2024
1 parent c627e5e commit 83392bb
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework and Mongo DB</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework.MongoDb</AssemblyTitle>
<Version>8.0.4.0</Version>
<Version>8.0.5.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework.MongoDb</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>8.0.4.0</AssemblyVersion>
<FileVersion>8.0.4.0</FileVersion>
<AssemblyVersion>8.0.5.0</AssemblyVersion>
<FileVersion>8.0.5.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework and SQL Server</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyTitle>
<Version>6.0.3.0</Version>
<Version>6.0.4.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>6.0.3.0</AssemblyVersion>
<FileVersion>6.0.3.0</FileVersion>
<AssemblyVersion>6.0.4.0</AssemblyVersion>
<FileVersion>6.0.4.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework and SQL Server</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyTitle>
<Version>7.0.3.0</Version>
<Version>7.0.4.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>7.0.3.0</AssemblyVersion>
<FileVersion>7.0.3.0</FileVersion>
<AssemblyVersion>7.0.4.0</AssemblyVersion>
<FileVersion>7.0.4.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework and SQL Server</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyTitle>
<Version>8.0.3.0</Version>
<Version>8.0.4.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>8.0.3.0</AssemblyVersion>
<FileVersion>8.0.3.0</FileVersion>
<AssemblyVersion>8.0.4.0</AssemblyVersion>
<FileVersion>8.0.4.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework and SQL Server</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyTitle>
<Version>4.3.3.0</Version>
<Version>4.3.4.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>eQuantic.Core.Data.EntityFramework.SqlServer</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>4.3.3.0</AssemblyVersion>
<FileVersion>4.3.3.0</FileVersion>
<AssemblyVersion>4.3.4.0</AssemblyVersion>
<FileVersion>4.3.4.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
9 changes: 8 additions & 1 deletion src/eQuantic.Core.Data.EntityFramework/Repository/SetBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,15 @@ public virtual void RemoveRange(params TEntity[] entities)

public virtual void SetModified(TEntity item)
{
var entry = this.DbContext.Entry<TEntity>(item);

if (DbContext.ChangeTracker.AutoDetectChangesEnabled && entry.State != EntityState.Detached)
{
return;
}

//this operation also attach item in object state manager
this.DbContext.Entry<TEntity>(item).State = EntityState.Modified;
entry.State = EntityState.Modified;
}

public override string ToString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework</AssemblyTitle>
<Version>6.0.5.0</Version>
<Version>6.0.6.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>6.0.5.0</AssemblyVersion>
<FileVersion>6.0.5.0</FileVersion>
<AssemblyVersion>6.0.6.0</AssemblyVersion>
<FileVersion>6.0.6.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework</AssemblyTitle>
<Version>7.0.4.0</Version>
<Version>7.0.5.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net7.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>7.0.4.0</AssemblyVersion>
<FileVersion>7.0.4.0</FileVersion>
<AssemblyVersion>7.0.5.0</AssemblyVersion>
<FileVersion>7.0.5.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework</AssemblyTitle>
<Version>8.0.5.0</Version>
<Version>8.0.6.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>eQuantic.Core.Data.EntityFramework</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>8.0.5.0</AssemblyVersion>
<FileVersion>8.0.5.0</FileVersion>
<AssemblyVersion>8.0.6.0</AssemblyVersion>
<FileVersion>8.0.6.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<Description>Core Data library for Entity Framework</Description>
<AssemblyTitle>eQuantic.Core.Data.EntityFramework</AssemblyTitle>
<Version>4.3.3.0</Version>
<Version>4.3.4.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>eQuantic.Core.Data.EntityFramework</AssemblyName>
Expand All @@ -23,8 +23,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2016</Copyright>
<AssemblyVersion>4.3.3.0</AssemblyVersion>
<FileVersion>4.3.3.0</FileVersion>
<AssemblyVersion>4.3.4.0</AssemblyVersion>
<FileVersion>4.3.4.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down

0 comments on commit 83392bb

Please sign in to comment.