diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index c39fbbe..97d908b 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -8,6 +8,6 @@ "\\Demo\\Domain\\UseCase", "\\Demo\\UI" ], - "SelectedNode": "\\Demo\\Data\\Repository\\GroupRepositoryImpl.cs", + "SelectedNode": "\\Demo\\Domain\\UseCase\\UserUseCase.cs", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/presence/FileContentIndex/17c45aee-627c-4051-92e0-bc1a5de01d74.vsidx b/.vs/presence/FileContentIndex/17c45aee-627c-4051-92e0-bc1a5de01d74.vsidx new file mode 100644 index 0000000..e2d0796 Binary files /dev/null and b/.vs/presence/FileContentIndex/17c45aee-627c-4051-92e0-bc1a5de01d74.vsidx differ diff --git a/.vs/presence/FileContentIndex/3726f4b7-682f-4230-a3ae-f4a65987e687.vsidx b/.vs/presence/FileContentIndex/3726f4b7-682f-4230-a3ae-f4a65987e687.vsidx new file mode 100644 index 0000000..1fb5d56 Binary files /dev/null and b/.vs/presence/FileContentIndex/3726f4b7-682f-4230-a3ae-f4a65987e687.vsidx differ diff --git a/.vs/presence/FileContentIndex/66dee230-a3d4-460e-b410-8e5619ec9c8c.vsidx b/.vs/presence/FileContentIndex/66dee230-a3d4-460e-b410-8e5619ec9c8c.vsidx deleted file mode 100644 index 61357eb..0000000 Binary files a/.vs/presence/FileContentIndex/66dee230-a3d4-460e-b410-8e5619ec9c8c.vsidx and /dev/null differ diff --git a/.vs/presence/FileContentIndex/8cecf5e7-34a4-44a5-be56-bee84ac1b3ea.vsidx b/.vs/presence/FileContentIndex/8cecf5e7-34a4-44a5-be56-bee84ac1b3ea.vsidx new file mode 100644 index 0000000..5369f9c Binary files /dev/null and b/.vs/presence/FileContentIndex/8cecf5e7-34a4-44a5-be56-bee84ac1b3ea.vsidx differ diff --git a/.vs/presence/FileContentIndex/cff1d91a-b5b6-4f3f-879c-09a8adda8682.vsidx b/.vs/presence/FileContentIndex/cff1d91a-b5b6-4f3f-879c-09a8adda8682.vsidx deleted file mode 100644 index 54c14b0..0000000 Binary files a/.vs/presence/FileContentIndex/cff1d91a-b5b6-4f3f-879c-09a8adda8682.vsidx and /dev/null differ diff --git a/.vs/presence/FileContentIndex/dcce74d1-3d03-44d8-ab4c-9ef1a8cee5f2.vsidx b/.vs/presence/FileContentIndex/dcce74d1-3d03-44d8-ab4c-9ef1a8cee5f2.vsidx deleted file mode 100644 index 70aef67..0000000 Binary files a/.vs/presence/FileContentIndex/dcce74d1-3d03-44d8-ab4c-9ef1a8cee5f2.vsidx and /dev/null differ diff --git a/.vs/presence/FileContentIndex/aa785a8b-3361-4739-9c4a-438b59d41935.vsidx b/.vs/presence/FileContentIndex/ecb54389-0b9e-4ac9-a4c3-5ce89ce3232b.vsidx similarity index 100% rename from .vs/presence/FileContentIndex/aa785a8b-3361-4739-9c4a-438b59d41935.vsidx rename to .vs/presence/FileContentIndex/ecb54389-0b9e-4ac9-a4c3-5ce89ce3232b.vsidx diff --git a/.vs/presence/v17/.wsuo b/.vs/presence/v17/.wsuo index a455aa3..5e5186e 100644 Binary files a/.vs/presence/v17/.wsuo and b/.vs/presence/v17/.wsuo differ diff --git a/.vs/presence/v17/DocumentLayout.backup.json b/.vs/presence/v17/DocumentLayout.backup.json index fb871ad..9a4a6b3 100644 --- a/.vs/presence/v17/DocumentLayout.backup.json +++ b/.vs/presence/v17/DocumentLayout.backup.json @@ -2,6 +2,10 @@ "Version": 1, "WorkspaceRootPath": "C:\\Users\\profi\\source\\repos\\presence\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Data\\Repository\\GroupRepositoryImpl.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Data\\Repository\\GroupRepositoryImpl.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -10,10 +14,6 @@ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\GroupUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\GroupUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\UI\\UserConsole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\UI\\UserConsole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -26,11 +26,11 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": 2, "Children": [ { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 1, "Title": "GroupRepositoryImpl.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Data\\Repository\\GroupRepositoryImpl.cs", "RelativeDocumentMoniker": "Demo\\Data\\Repository\\GroupRepositoryImpl.cs", @@ -43,7 +43,7 @@ }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 2, "Title": "GroupUseCase.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\GroupUseCase.cs", "RelativeDocumentMoniker": "Demo\\Domain\\UseCase\\GroupUseCase.cs", @@ -51,18 +51,17 @@ "RelativeToolTip": "Demo\\Domain\\UseCase\\GroupUseCase.cs", "ViewState": "AgIAAAMAAAAAAAAAAAAAABoAAAAxAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-10-16T09:23:36.604Z", - "EditorCaption": "" + "WhenOpened": "2024-10-16T09:23:36.604Z" }, { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 0, "Title": "UserUseCase.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs", "RelativeDocumentMoniker": "Demo\\Domain\\UseCase\\UserUseCase.cs", - "ToolTip": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs", - "RelativeToolTip": "Demo\\Domain\\UseCase\\UserUseCase.cs", - "ViewState": "AgIAABIAAAAAAAAAAAAwwCIAAAAvAAAAAAAAAA==", + "ToolTip": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs*", + "RelativeToolTip": "Demo\\Domain\\UseCase\\UserUseCase.cs*", + "ViewState": "AgIAAAAAAAAAAAAAAAAAACIAAAAvAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-10-16T09:39:07.152Z", "EditorCaption": "" @@ -77,8 +76,7 @@ "RelativeToolTip": "Demo\\UI\\UserConsole.cs", "ViewState": "AgIAAB4AAAAAAAAAAAAAADYAAAA5AAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-10-16T07:06:47.821Z", - "EditorCaption": "" + "WhenOpened": "2024-10-16T07:06:47.821Z" } ] } diff --git a/.vs/presence/v17/DocumentLayout.json b/.vs/presence/v17/DocumentLayout.json index fb871ad..f1d30c5 100644 --- a/.vs/presence/v17/DocumentLayout.json +++ b/.vs/presence/v17/DocumentLayout.json @@ -2,6 +2,10 @@ "Version": 1, "WorkspaceRootPath": "C:\\Users\\profi\\source\\repos\\presence\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Data\\Repository\\GroupRepositoryImpl.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Data\\Repository\\GroupRepositoryImpl.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -10,10 +14,6 @@ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\GroupUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\GroupUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\Domain\\UseCase\\UserUseCase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\profi\\source\\repos\\presence\\Demo\\UI\\UserConsole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Demo\\UI\\UserConsole.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -26,11 +26,11 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": 2, "Children": [ { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 1, "Title": "GroupRepositoryImpl.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Data\\Repository\\GroupRepositoryImpl.cs", "RelativeDocumentMoniker": "Demo\\Data\\Repository\\GroupRepositoryImpl.cs", @@ -38,12 +38,11 @@ "RelativeToolTip": "Demo\\Data\\Repository\\GroupRepositoryImpl.cs", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-10-17T11:23:48.997Z", - "EditorCaption": "" + "WhenOpened": "2024-10-17T11:23:48.997Z" }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 2, "Title": "GroupUseCase.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\GroupUseCase.cs", "RelativeDocumentMoniker": "Demo\\Domain\\UseCase\\GroupUseCase.cs", @@ -51,18 +50,17 @@ "RelativeToolTip": "Demo\\Domain\\UseCase\\GroupUseCase.cs", "ViewState": "AgIAAAMAAAAAAAAAAAAAABoAAAAxAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-10-16T09:23:36.604Z", - "EditorCaption": "" + "WhenOpened": "2024-10-16T09:23:36.604Z" }, { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 0, "Title": "UserUseCase.cs", "DocumentMoniker": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs", "RelativeDocumentMoniker": "Demo\\Domain\\UseCase\\UserUseCase.cs", - "ToolTip": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs", - "RelativeToolTip": "Demo\\Domain\\UseCase\\UserUseCase.cs", - "ViewState": "AgIAABIAAAAAAAAAAAAwwCIAAAAvAAAAAAAAAA==", + "ToolTip": "C:\\Users\\profi\\source\\repos\\presence\\Demo\\Domain\\UseCase\\UserUseCase.cs*", + "RelativeToolTip": "Demo\\Domain\\UseCase\\UserUseCase.cs*", + "ViewState": "AgIAABUAAAAAAAAAAAAAADIAAAANAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-10-16T09:39:07.152Z", "EditorCaption": "" @@ -77,8 +75,7 @@ "RelativeToolTip": "Demo\\UI\\UserConsole.cs", "ViewState": "AgIAAB4AAAAAAAAAAAAAADYAAAA5AAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-10-16T07:06:47.821Z", - "EditorCaption": "" + "WhenOpened": "2024-10-16T07:06:47.821Z" } ] } diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 339aabc..a6a4743 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/Demo/Data/Repository/GroupRepositoryImpl.cs b/Demo/Data/Repository/GroupRepositoryImpl.cs index 063390d..20ebe02 100644 --- a/Demo/Data/Repository/GroupRepositoryImpl.cs +++ b/Demo/Data/Repository/GroupRepositoryImpl.cs @@ -2,27 +2,44 @@ using Demo.domain.Models; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Demo.Data.Repository { + [DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")] public class GroupRepositoryImpl { - public List GetAllGroups() => LocalStaticData.groups; - } - public void AddGroup(GroupLocalEntity newGroup) - { - LocalStaticData.groups.Add(newGroup); - } + public List GetAllGroups() => LocalStaticData.groups; - public void UpdateGroupName(int GroupId, string NewName) - { - var group = LocalStaticData.groups.FirstOrDefault(g => g.Id == GroupId); - if (group != null) + public void AddGroup(GroupLocalEntity newGroup) { - group.Name = newName; + LocalStaticData.groups.Add(newGroup); } + + public void UpdateGroupName(int groupId, string newName) +{ + var group = LocalStaticData.groups.FirstOrDefault(g => g.Id == groupId); + if (group != null) + { + group.Name = newName; } } + + + public GroupLocalEntity GetGroupById(int groupId) + { + return LocalStaticData.groups.FirstOrDefault(g => g.Id == groupId); + } + + private static string GetDebuggerDisplay() + { + return $"GroupRepository with {LocalStaticData.groups.Count} groups"; + } + + internal void AddGroup(Group group) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Demo/Data/Repository/UserRepositoryImpl.cs b/Demo/Data/Repository/UserRepositoryImpl.cs index bf9ae8c..2a05b9f 100644 --- a/Demo/Data/Repository/UserRepositoryImpl.cs +++ b/Demo/Data/Repository/UserRepositoryImpl.cs @@ -11,9 +11,9 @@ namespace Demo.Data.Repository public class UserRepositoryImpl { public UserRepositoryImpl() { - GetAllUsers = LocalStaticData.users; } + public List GetAllUsers { get; set; } @@ -41,7 +41,6 @@ namespace Demo.Data.Repository userLocal.FIO = userUpdateLocalEnity.FIO; userLocal.GroupID = userUpdateLocalEnity.GroupID; return userLocal; - } } } diff --git a/Demo/Demo.sln b/Demo/Demo.sln new file mode 100644 index 0000000..444f121 --- /dev/null +++ b/Demo/Demo.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "Demo.csproj", "{B6BB8660-275A-42CF-978F-8D410FE7FEA5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B6BB8660-275A-42CF-978F-8D410FE7FEA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6BB8660-275A-42CF-978F-8D410FE7FEA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6BB8660-275A-42CF-978F-8D410FE7FEA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6BB8660-275A-42CF-978F-8D410FE7FEA5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4BCD1A90-B0DC-4013-B7B9-C109F9A925B4} + EndGlobalSection +EndGlobal diff --git a/Demo/Domain/Models/Group.cs b/Demo/Domain/Models/Group.cs index ce0914b..6353dde 100644 --- a/Demo/Domain/Models/Group.cs +++ b/Demo/Domain/Models/Group.cs @@ -10,5 +10,11 @@ namespace Demo.domain.Models { public required int Id { get; set; } public required string Name { get; set; } + + public static implicit operator Group(GroupLocalEntity v) + { + throw new NotImplementedException(); + } + } } diff --git a/Demo/Domain/UseCase/GroupUseCase.cs b/Demo/Domain/UseCase/GroupUseCase.cs index 3a64faa..9630c61 100644 --- a/Demo/Domain/UseCase/GroupUseCase.cs +++ b/Demo/Domain/UseCase/GroupUseCase.cs @@ -24,18 +24,13 @@ namespace Demo.Domain.UseCase public void AddGroup(Group group) { - _repositoryGroupImpl.AddGroup(group); + _repositoryGroupImpl.AddGroup(group: group); } public void UpdateGroupName(int groupId, string newName) - { - var group = _repositoryGroupImpl.GetGroupById(groupId); - if (group != null) - { - group.Name = newName; - _repositoryGroupImpl.UpdateGroup(group); - } - } +{ + _repositoryGroupImpl.UpdateGroupName(groupId, newName); +} } } \ No newline at end of file diff --git a/Demo/Domain/UseCase/UserUseCase.cs b/Demo/Domain/UseCase/UserUseCase.cs index 4780ca3..93a4ae4 100644 --- a/Demo/Domain/UseCase/UserUseCase.cs +++ b/Demo/Domain/UseCase/UserUseCase.cs @@ -35,12 +35,13 @@ namespace Demo.Domain.UseCase return _repositoryUserImpl.RemoveUserByGuid(userGuid); } public User UpdateUser(User user) { - UserLocalEnity userLocalEnity = new UserLocalEnity { FIO = user.FIO, GroupID = user.Group.Id, Guid = user.Guid }; - UserLocalEnity? result = _repositoryUserImpl.UpdateUser(userLocalEnity); + UserLocalEnity userLocalEnity = new UserLocalEnity { FIO = user.FIO, GroupID = user.Group.Id, Guid = user.Guid }; + UserLocalEnity? result = _repositoryUserImpl.UpdateUser(userLocalEnity); if (result == null) throw new Exception(""); Group? group = GetAllGroups().FirstOrDefault(it => it.Id == result!.GroupID); - if (group == null) throw new Exception(""); - return new User { FIO = user.FIO, Guid = user.Guid, Group = group}; + if (group == null) throw new Exception("Группа не найдена"); + return new User { FIO = user.FIO, Guid = user.Guid, Group = group }; +} public User FindUserByGuid(Guid userGuid) { @@ -50,5 +51,4 @@ namespace Demo.Domain.UseCase return new User { FIO = user.FIO, Guid = user.Guid, Group = group }; } } - } -} + } \ No newline at end of file diff --git a/Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs b/Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs index c4e7b2b..b4b2d60 100644 --- a/Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs +++ b/Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// Этот код создан программой. -// Исполняемая версия:4.0.30319.42000 +// This code was generated by a tool. // -// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае -// повторной генерации кода. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Demo")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+74ec2fdea7a678f89a686dd1c62c7529dfe83231")] [assembly: System.Reflection.AssemblyProductAttribute("Demo")] [assembly: System.Reflection.AssemblyTitleAttribute("Demo")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Создано классом WriteCodeFragment MSBuild. +// Generated by the MSBuild WriteCodeFragment class. diff --git a/Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache b/Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache index 027d67d..721ec72 100644 --- a/Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache +++ b/Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache @@ -1 +1 @@ -eb16b2b154799358c5c37f7f25193ef306ab5592617791ff431f7a24a66875c2 +99617ed546c21c3c878e2446fcd661ed283e5ecc68438b468fcd6c1917a360ae