Skip to content

Commit

Permalink
Merge pull request #25 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
Fix memory leak
  • Loading branch information
Ali-YousefiTelori authored Sep 30, 2023
2 parents c17b0c1 + be3aca4 commit a634c1e
Show file tree
Hide file tree
Showing 22 changed files with 177 additions and 459 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
using EasyMicroservices.ContentsMicroservice.Database.Entities;
using EasyMicroservices.Cores.Relational.EntityFrameworkCore;
using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces;
using Microsoft.EntityFrameworkCore;
using System;

namespace EasyMicroservices.ContentsMicroservice.Database.Contexts
{
public class ContentContext : RelationalCoreContext
{
IDatabaseBuilder _builder;
public ContentContext(IDatabaseBuilder builder)
public ContentContext(IEntityFrameworkCoreDatabaseBuilder builder) : base(builder)
{
_builder = builder;
}

public DbSet<CategoryEntity> Categories { get; set; }
public DbSet<ContentEntity> Contents { get; set; }
public DbSet<LanguageEntity> Languages { get; set; }


protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (_builder != null)
_builder.OnConfiguring(optionsBuilder);
base.OnConfiguring(optionsBuilder);
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ItemGroup>
<PackageReference Include="EasyMicroservices.Configuration" Version="0.0.0.2" />
<PackageReference Include="EasyMicroservices.Cores.Relational.EntityFrameworkCore" Version="0.0.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.10" />
<!--<PackageReference Include="EasyMicroservices.Cores.Relational.EntityFrameworkCore" Version="0.0.0.23" />-->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Cores.Database" Version="0.0.0.32" />
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.0.18" />
</ItemGroup>

</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyMicroservices.Cores.AspEntityFrameworkCoreApi" Version="0.0.0.12" />
<PackageReference Include="EasyMicroservices.Mapper.CompileTimeMapper" Version="0.0.0.6" />
<PackageReference Include="EasyMicroservices.Mapper.SerializerMapper" Version="0.0.0.3" />
<PackageReference Include="EasyMicroservices.Serialization.Newtonsoft.Json" Version="0.0.0.6" />
</ItemGroup>

<ItemGroup>
<Folder Include="DatabaseLogics\" />
<Folder Include="Helpers\" />
<Folder Include="Interfaces\" />
<Folder Include="Mappers\" />
</ItemGroup>

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyMicroservices.ContentsMicroservice.Database;
using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
Expand All @@ -9,16 +10,18 @@

namespace EasyMicroservices.ContentsMicroservice
{
public class DatabaseBuilder : IDatabaseBuilder
public class DatabaseBuilder : IEntityFrameworkCoreDatabaseBuilder
{
readonly IConfiguration config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.Build();
IConfiguration _configuration;
public DatabaseBuilder(IConfiguration configuration)
{
_configuration = configuration;
}

public void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseInMemoryDatabase("ContentDatabase");
//optionsBuilder.UseSqlServer(config.GetConnectionString("local"));
//optionsBuilder.UseSqlServer(_configuration.GetConnectionString("local"));
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="EasyMicroservices.WhiteLabelsMicroservice.Clients" Version="0.0.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.11" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
</ItemGroup>
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit a634c1e

Please sign in to comment.