Skip to content

Commit 8a7b550

Browse files
committed
update
1 parent cf1def2 commit 8a7b550

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1041
-811
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace Mix.Heart.Entities
4+
{
5+
public abstract class AuditEntityBase<TPrimaryKey> : SimpleEntityBase<TPrimaryKey> where TPrimaryKey : IComparable
6+
{
7+
public DateTime CreatedDateTime { get; set; }
8+
public DateTime? LastModified { get; set; }
9+
public string CreatedBy { get; set; }
10+
public string ModifiedBy { get; set; }
11+
}
12+
}

src/mix.heart/Entities/Cache/MixCacheDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.Extensions.Configuration;
23
using Mix.Heart.Enums;
34
using Mix.Heart.Models;
4-
using Mix.Shared.Services;
55

66
namespace Mix.Heart.Entities.Cache
77
{
88
public partial class MixCacheDbContext : DbContext
99
{
1010
private readonly MixHeartConfigurationModel _configs;
1111

12-
public MixCacheDbContext()
12+
public MixCacheDbContext(IConfiguration configuration)
1313
{
14-
_configs = MixHeartConfigService.Instance.AppSettings;
14+
_configs = configuration.Get<MixHeartConfigurationModel>();
1515
}
1616

1717
public virtual DbSet<MixCache> MixCache { get; set; }

src/mix.heart/Entities/Cache/MsSqlCacheDbContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.Extensions.Configuration;
23
using Mix.Heart.EntityFrameworkCore.Extensions;
34

45
namespace Mix.Heart.Entities.Cache
56
{
67
public partial class MsSqlCacheDbContext : MixCacheDbContext
78
{
8-
public MsSqlCacheDbContext() : base()
9+
public MsSqlCacheDbContext(IConfiguration configuration) : base(configuration)
910
{
1011

1112
}

src/mix.heart/Entities/Cache/MySqlCacheDbContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
using Microsoft.EntityFrameworkCore;
3+
using Microsoft.Extensions.Configuration;
34
using Mix.Heart.EntityFrameworkCore.Extensions;
45

56
namespace Mix.Heart.Entities.Cache
67
{
78
public partial class MySqlCacheDbContext : MixCacheDbContext
89
{
9-
public MySqlCacheDbContext() : base()
10+
public MySqlCacheDbContext(IConfiguration configuration) : base(configuration)
1011
{
1112

1213
}

src/mix.heart/Entities/Cache/PostgresCacheDbContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
using Microsoft.EntityFrameworkCore;
3+
using Microsoft.Extensions.Configuration;
34
using Mix.Heart.EntityFrameworkCore.Extensions;
45

56
namespace Mix.Heart.Entities.Cache
67
{
78
public partial class PostgresCacheDbContext : MixCacheDbContext
89
{
9-
public PostgresCacheDbContext() : base()
10+
public PostgresCacheDbContext(IConfiguration configuration) : base(configuration)
1011
{
1112

1213
}

src/mix.heart/Entities/Cache/SqliteCacheDbContext.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.Extensions.Configuration;
23
using Mix.Heart.EntityFrameworkCore.Extensions;
34

45
namespace Mix.Heart.Entities.Cache
56
{
67
public partial class SqliteCacheDbContext : MixCacheDbContext
78
{
8-
public SqliteCacheDbContext() : base()
9+
public SqliteCacheDbContext(IConfiguration configuration) : base(configuration)
910
{
1011

1112
}

src/mix.heart/Entities/EntityBase.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
using Mix.Heart.Enums;
22
using System;
3-
using System.ComponentModel.DataAnnotations;
4-
using System.ComponentModel.DataAnnotations.Schema;
53

64
namespace Mix.Heart.Entities
75
{
8-
public abstract class EntityBase<TPrimaryKey> : IEntity<TPrimaryKey>
9-
where TPrimaryKey : IComparable
6+
public abstract class EntityBase<TPrimaryKey> : SimpleEntityBase<TPrimaryKey> where TPrimaryKey : IComparable
107
{
11-
[Key]
12-
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13-
public TPrimaryKey Id { get; set; }
148
public DateTime CreatedDateTime { get; set; }
159
public DateTime? LastModified { get; set; }
1610
public string CreatedBy { get; set; }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.ComponentModel.DataAnnotations;
3+
using System.ComponentModel.DataAnnotations.Schema;
4+
5+
namespace Mix.Heart.Entities
6+
{
7+
public abstract class SimpleEntityBase<TPrimaryKey> : IEntity<TPrimaryKey> where TPrimaryKey : IComparable
8+
{
9+
[Key]
10+
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
11+
public TPrimaryKey Id { get; set; }
12+
}
13+
}

src/mix.heart/Enums/ExpressionMethod.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public enum ExpressionMethod
44
{
55
Equal,
66
Like,
7+
ILike,
8+
ILikeUnaccent,
79
In,
810
NotIn,
911
NotEqual,

src/mix.heart/Enums/MixCacheMode.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
public enum MixCacheMode
44
{
55
JSON,
6-
DATABASE,
76
REDIS
87
}
98
}

0 commit comments

Comments
 (0)