From bb633b3024cbffa66497a06d01038ec449309831 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:12:17 +0800 Subject: [PATCH] Updated Repository Layer (markdown) --- Repository-Layer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Repository-Layer.md b/Repository-Layer.md index 1d76d4b..0db63e3 100644 --- a/Repository-Layer.md +++ b/Repository-Layer.md @@ -124,15 +124,15 @@ Dictionary CompareState(TEntity newdata); Suppose we have two entities: `User` and `Topic`, and two repositories are defined in the domain class: ```csharp -var userRepository = fsql.GetGuidRepository(); -var topicRepository = fsql.GetGuidRepository(); +var userRepository = fsql.GetRepository(); +var topicRepository = fsql.GetRepository(); ``` In practice, we always worry about the data security of `topicRepository`, that is, it is possible to query or change the topic of other users. Therefore, we have made improvements in the v0.0.7 version, adding the filter lambda expression parameter. ```csharp -var userRepository = fsql.GetGuidRepository(a => a.Id == 1); -var topicRepository = fsql.GetGuidRepository(a => a.UserId == 1); +var userRepository = fsql.GetRepository(a => a.Id == 1); +var topicRepository = fsql.GetRepository(a => a.UserId == 1); ``` * Attach this condition when querying/modifying/deleting, so that the data of other users will not be modified.