From 3375a75312482734dfc1330f9a7151ece55cf4e1 Mon Sep 17 00:00:00 2001 From: Karan Batavia Date: Thu, 29 Feb 2024 16:36:36 +0530 Subject: [PATCH 1/4] add storage rules for c# --- .../Microsoft.EntityFrameworkCore/csharp.yaml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml diff --git a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml new file mode 100644 index 00000000..c9c1d009 --- /dev/null +++ b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml @@ -0,0 +1,25 @@ +sinks: + + - id: Storages.EntityFrameworkCore.Write + name: Entity Framework DB Connector + domains: + - learn.microsoft.com/ef/core + patterns: + - "(?i).*(IRepository).*(Add|AddOrUpdate|AddRange).*" + tags: + + - id: Storages.EntityFrameworkCore.Read + name: Entity Framework DB Connector + domains: + - learn.microsoft.com/ef/core + patterns: + - "(?i).*(IRepository).*(Find|Find|Fiest|ForEach||LongCount|ToArray|Single)(Async)?.*" + tags: + + - id: Storages.EntityFrameworkCore.Delete + name: Entity Framework DB Connector + domains: + - learn.microsoft.com/ef/core + patterns: + - "(?i).*(IRepository).*(Remove|RemoveRange).*" + tags: \ No newline at end of file From 7559d44f6c8b1ebd43c9d4f04b3087ea2e661fa8 Mon Sep 17 00:00:00 2001 From: Karan Batavia Date: Thu, 29 Feb 2024 16:54:14 +0530 Subject: [PATCH 2/4] fix rule --- rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml index c9c1d009..9da69acb 100644 --- a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml +++ b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml @@ -13,7 +13,7 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository).*(Find|Find|Fiest|ForEach||LongCount|ToArray|Single)(Async)?.*" + - "(?i).*(IRepository).*(Find|Find|Fiest|ForEach|LongCount|ToArray|Single)(Async)?.*" tags: - id: Storages.EntityFrameworkCore.Delete From 142876b3d7f4c3b50ba5b094f265dc4107b8f30f Mon Sep 17 00:00:00 2001 From: Karan Batavia Date: Mon, 4 Mar 2024 13:24:49 +0530 Subject: [PATCH 3/4] Merge delete rules to write, and fix typos --- .../storages/Microsoft.EntityFrameworkCore/csharp.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml index 9da69acb..2dee9cb3 100644 --- a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml +++ b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml @@ -5,7 +5,7 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository).*(Add|AddOrUpdate|AddRange).*" + - "(?i).*(IRepository|DBSet).*(Add|AddOrUpdate|AddRange)(Async)?.*" tags: - id: Storages.EntityFrameworkCore.Read @@ -13,7 +13,7 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository).*(Find|Find|Fiest|ForEach|LongCount|ToArray|Single)(Async)?.*" + - "(?i).*(IRepository|DBSet).*(Find|Find|Fiest|ForEach|LongCount|ToArray|Single)(Async)?.*" tags: - id: Storages.EntityFrameworkCore.Delete @@ -21,5 +21,5 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository).*(Remove|RemoveRange).*" + - "(?i).*(IRepository|DBSet).*(Remove|RemoveRange)(Async)?.*" tags: \ No newline at end of file From ecc4908ce4592be433cd6e4461c11ff7ae8b3bd6 Mon Sep 17 00:00:00 2001 From: Karan Batavia Date: Mon, 4 Mar 2024 13:25:39 +0530 Subject: [PATCH 4/4] Merge delete rules to write, and fix typos --- .../Microsoft.EntityFrameworkCore/csharp.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml index 2dee9cb3..2e9e7abf 100644 --- a/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml +++ b/rules/sinks/storages/Microsoft.EntityFrameworkCore/csharp.yaml @@ -5,7 +5,7 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository|DBSet).*(Add|AddOrUpdate|AddRange)(Async)?.*" + - "(?i).*(IRepository|DBSet).*(Add|AddOrUpdate|AddRange|Remove|RemoveRange)(Async)?.*" tags: - id: Storages.EntityFrameworkCore.Read @@ -13,13 +13,5 @@ sinks: domains: - learn.microsoft.com/ef/core patterns: - - "(?i).*(IRepository|DBSet).*(Find|Find|Fiest|ForEach|LongCount|ToArray|Single)(Async)?.*" - tags: - - - id: Storages.EntityFrameworkCore.Delete - name: Entity Framework DB Connector - domains: - - learn.microsoft.com/ef/core - patterns: - - "(?i).*(IRepository|DBSet).*(Remove|RemoveRange)(Async)?.*" + - "(?i).*(IRepository|DBSet).*(Find|First|ForEach|LongCount|ToArray|Single)(Async)?.*" tags: \ No newline at end of file