init
This commit is contained in:
commit
71b5a3c283
25
Demo.sln
Normal file
25
Demo.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35312.102
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{983820F6-FF31-4B3A-8593-831BC3904E80}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{983820F6-FF31-4B3A-8593-831BC3904E80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{983820F6-FF31-4B3A-8593-831BC3904E80}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{983820F6-FF31-4B3A-8593-831BC3904E80}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{983820F6-FF31-4B3A-8593-831BC3904E80}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4F43A963-447C-4FCB-BB78-8D315EC0F1D6}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
10
Demo/Data/Exceptions/GroupNotFoundException.cs
Normal file
10
Demo/Data/Exceptions/GroupNotFoundException.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class GroupNotFoundException : RepositoryException
|
||||
{
|
||||
public GroupNotFoundException(int userId)
|
||||
: base($"Группа с ID {userId} не найдена.") { }
|
||||
}
|
||||
}
|
9
Demo/Data/Exceptions/RepositoryException.cs
Normal file
9
Demo/Data/Exceptions/RepositoryException.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class RepositoryException : Exception
|
||||
{
|
||||
public RepositoryException(string message) : base(message) { }
|
||||
}
|
||||
}
|
10
Demo/Data/Exceptions/UserNotFoundException.cs
Normal file
10
Demo/Data/Exceptions/UserNotFoundException.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Demo.Data.Exceptions
|
||||
{
|
||||
public class UserNotFoundException : RepositoryException
|
||||
{
|
||||
public UserNotFoundException(int userId)
|
||||
: base($"Пользователь с ID {userId} не найден.") { }
|
||||
}
|
||||
}
|
15
Demo/Data/LocalData/Entity/Group.cs
Normal file
15
Demo/Data/LocalData/Entity/Group.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
public class GroupLocalEntity
|
||||
{
|
||||
public required int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
|
||||
}
|
||||
}
|
17
Demo/Data/LocalData/Entity/Presence.cs
Normal file
17
Demo/Data/LocalData/Entity/Presence.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
internal class PresenceLocalEntity
|
||||
{
|
||||
public required Guid UserGuid { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
public required DateOnly Date { get; set; }
|
||||
|
||||
public required int LessonNumber { get; set; }
|
||||
}
|
||||
}
|
26
Demo/Data/LocalData/Entity/User.cs
Normal file
26
Demo/Data/LocalData/Entity/User.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
public class UserLocalEnity : IEquatable<UserLocalEnity>
|
||||
{
|
||||
|
||||
public required string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
public int ID { get; set; }
|
||||
|
||||
public required int GroupID { get; set; }
|
||||
|
||||
|
||||
|
||||
public bool Equals(UserLocalEnity? other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
return this.Guid.Equals(other.Guid);
|
||||
}
|
||||
}
|
||||
}
|
31
Demo/Data/LocalData/LocalStaticData.cs
Normal file
31
Demo/Data/LocalData/LocalStaticData.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.LocalData
|
||||
{
|
||||
public static class LocalStaticData
|
||||
{
|
||||
public static List<GroupLocalEntity> groups => new List<GroupLocalEntity>
|
||||
|
||||
{
|
||||
new GroupLocalEntity{ Id = 1, Name = "ИП1-21" },
|
||||
new GroupLocalEntity{ Id = 2, Name = "ИП1-22" },
|
||||
new GroupLocalEntity{ Id = 3, Name = "ИП1-23" },
|
||||
};
|
||||
|
||||
public static List<UserLocalEnity> users => new List<UserLocalEnity>
|
||||
{
|
||||
new UserLocalEnity{ID = 1,Guid=Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9"), FIO = "RandomFio", GroupID = 1 },
|
||||
new UserLocalEnity{ID = 2,Guid=Guid.Parse("8388d931-5bef-41be-a152-78f1aca980ed"), FIO = "RandomFio1", GroupID = 2 },
|
||||
new UserLocalEnity{ID = 3, Guid=Guid.Parse("ed174548-49ed-4503-a902-c970cbf27173"), FIO = "RandomFio2", GroupID = 3 },
|
||||
new UserLocalEnity{ID = 4, Guid=Guid.Parse("614c0a23-5bd5-43ae-b48e-d5750afbc282"), FIO = "RandomFio3", GroupID = 1 },
|
||||
new UserLocalEnity{ID = 5, Guid=Guid.Parse("efcc1473-c116-4244-b3f7-f2341a5c3003"), FIO = "RandomFio4", GroupID = 2 },
|
||||
new UserLocalEnity{ID = 6, Guid=Guid.Parse("60640fb3-ace2-4cad-81d5-a0a58bc2dbbd"), FIO = "RandomFio5", GroupID = 3 },
|
||||
};
|
||||
}
|
||||
}
|
53
Demo/Data/Repository/GroupRepositoryImpl.cs
Normal file
53
Demo/Data/Repository/GroupRepositoryImpl.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.domain.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class GroupRepositoryImpl
|
||||
{
|
||||
private List<GroupLocalEntity> _groups = LocalStaticData.groups;
|
||||
|
||||
|
||||
public GroupLocalEntity? GetGroupById(int groupId)
|
||||
{
|
||||
foreach (var group in _groups)
|
||||
{
|
||||
if (group.Id == groupId)
|
||||
{
|
||||
return group;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Метод для получения всех групп
|
||||
public List<GroupLocalEntity> GetAllGroups() => _groups;
|
||||
|
||||
// Метод для добавления новой группы
|
||||
public void AddGroup(GroupLocalEntity group)
|
||||
{
|
||||
group.Id = _groups.Any() ? _groups.Max(g => g.Id) + 1 : 1;
|
||||
_groups.Add(group);
|
||||
}
|
||||
|
||||
// Метод для обновления существующей группы
|
||||
public void UpdateGroup(GroupLocalEntity group)
|
||||
{
|
||||
var existingGroup = GetGroupById(group.Id);
|
||||
if (existingGroup == null) throw new GroupNotFoundException(group.Id);
|
||||
}
|
||||
|
||||
public void RemoveGroupById(GroupLocalEntity group)
|
||||
{
|
||||
var existingGroup = GetGroupById(group.Id);
|
||||
if (existingGroup == null) throw new GroupNotFoundException(group.Id);
|
||||
if (_groups.Contains(existingGroup))
|
||||
{
|
||||
_groups.Remove(existingGroup);
|
||||
}
|
||||
}
|
||||
}
|
18
Demo/Data/Repository/IGroupRepository.cs
Normal file
18
Demo/Data/Repository/IGroupRepository.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public interface IGroupRepository
|
||||
{
|
||||
List<GroupLocalEntity> GetAllGroup();
|
||||
bool RemoveGroupById(int groupID);
|
||||
bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup);
|
||||
GroupLocalEntity GetGroupById(int groupID);
|
||||
bool AddGroup(GroupLocalEntity newGroup);
|
||||
}
|
||||
}
|
41
Demo/Data/Repository/UserRepositoryImpl.cs
Normal file
41
Demo/Data/Repository/UserRepositoryImpl.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.domain.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Demo.Data.Repository
|
||||
{
|
||||
public class UserRepositoryImpl
|
||||
{
|
||||
private List<UserLocalEnity> _users;
|
||||
|
||||
public UserRepositoryImpl()
|
||||
{
|
||||
_users = LocalStaticData.users;
|
||||
}
|
||||
|
||||
public IEnumerable<UserLocalEnity> GetAllUsers => _users;
|
||||
|
||||
public bool RemoveUserById(int userId)
|
||||
{
|
||||
var user = _users.FirstOrDefault(u => u.ID == userId);
|
||||
if (user == null) throw new UserNotFoundException(userId);
|
||||
|
||||
_users.Remove(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
public UserLocalEnity? UpdateUser(UserLocalEnity user)
|
||||
{
|
||||
var existingUser = _users.FirstOrDefault(u => u.Guid == user.Guid);
|
||||
if (existingUser == null) throw new UserNotFoundException(user.ID);
|
||||
|
||||
existingUser.FIO = user.FIO;
|
||||
existingUser.GroupID = user.GroupID;
|
||||
|
||||
return existingUser;
|
||||
}
|
||||
}
|
||||
}
|
14
Demo/Demo.csproj
Normal file
14
Demo/Demo.csproj
Normal file
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Data\RemoteData\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
14
Demo/Domain/Models/Group.cs
Normal file
14
Demo/Domain/Models/Group.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
public class Group
|
||||
{
|
||||
public required int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
}
|
18
Demo/Domain/Models/Presence.cs
Normal file
18
Demo/Domain/Models/Presence.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
public class Presence
|
||||
{
|
||||
|
||||
public required User User { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
public required DateOnly Date { get; set; }
|
||||
|
||||
public required int LessonNumber { get; set; }
|
||||
}
|
||||
}
|
16
Demo/Domain/Models/User.cs
Normal file
16
Demo/Domain/Models/User.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public required string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
public int ID { get; set; }
|
||||
public required Group Group { get; set; }
|
||||
}
|
||||
}
|
123
Demo/Domain/UseCase/GroupUseCase.cs
Normal file
123
Demo/Domain/UseCase/GroupUseCase.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using Demo.Data.LocalData;
|
||||
using Demo.domain.Models;
|
||||
|
||||
namespace Demo.Domain.UseCase
|
||||
{
|
||||
public class GroupUseCase
|
||||
{
|
||||
private readonly GroupRepositoryImpl _repositoryGroupImpl;
|
||||
|
||||
public GroupUseCase(GroupRepositoryImpl repositoryGroupImpl)
|
||||
{
|
||||
_repositoryGroupImpl = repositoryGroupImpl;
|
||||
}
|
||||
|
||||
// Приватный метод для валидации имени группы
|
||||
private void ValidateGroupName(string groupName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(groupName))
|
||||
{
|
||||
throw new ArgumentException("Имя группы не может быть пустым.");
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateGroupId(int GroupId)
|
||||
{
|
||||
if(GroupId < 1)
|
||||
{
|
||||
throw new ArgumentException("Введите корректный ID группы.");
|
||||
}
|
||||
}
|
||||
|
||||
// Приватный метод для валидации существования группы по ID
|
||||
private GroupLocalEntity ValidateGroupExistence(int groupId)
|
||||
{
|
||||
var existingGroup = _repositoryGroupImpl.GetAllGroups()
|
||||
.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
if (existingGroup == null)
|
||||
{
|
||||
throw new ArgumentException("Группа не найдена.");
|
||||
}
|
||||
|
||||
return existingGroup;
|
||||
}
|
||||
|
||||
|
||||
// Метод для получения списка всех групп
|
||||
public List<Group> GetAllGroups()
|
||||
{
|
||||
return _repositoryGroupImpl.GetAllGroups()
|
||||
.Select(it => new Group { Id = it.Id, Name = it.Name })
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
public void FindGroupById(int IdGroup)
|
||||
{
|
||||
List<Group> GetAllGroups()
|
||||
{
|
||||
return _repositoryGroupImpl.GetAllGroups()
|
||||
.Select(it => new Group { Id = it.Id, Name = it.Name })
|
||||
.ToList();
|
||||
}
|
||||
foreach(var group in GetAllGroups())
|
||||
{
|
||||
if (IdGroup == group.Id)
|
||||
{
|
||||
Console.WriteLine($"ID группы: {group.Id} Название группы: {group.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Метод для добавления новой группы
|
||||
public void AddGroup(string groupName)
|
||||
{
|
||||
ValidateGroupName(groupName);
|
||||
|
||||
var newId = _repositoryGroupImpl.GetAllGroups().Any()
|
||||
? _repositoryGroupImpl.GetAllGroups().Max(g => g.Id) + 1
|
||||
: 1;
|
||||
|
||||
GroupLocalEntity newGroup = new GroupLocalEntity
|
||||
{
|
||||
Id = newId,
|
||||
Name = groupName
|
||||
};
|
||||
|
||||
_repositoryGroupImpl.AddGroup(newGroup);
|
||||
}
|
||||
|
||||
public void RemoveGroupById(int groupId)
|
||||
{
|
||||
ValidateGroupId(groupId);
|
||||
var existingGroup = ValidateGroupExistence(groupId);
|
||||
List<Group> _groups = GetAllGroups();
|
||||
|
||||
// Находим группу по ID и удаляем ее
|
||||
var groupToRemove = _groups.FirstOrDefault(g => g.Id == existingGroup.Id);
|
||||
if (groupToRemove != null)
|
||||
{
|
||||
_groups.Remove(groupToRemove);
|
||||
_repositoryGroupImpl.RemoveGroupById(existingGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Группа не найдена.");
|
||||
// Обработка случая, если группа не найдена (например, выброс исключения)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Метод для изменения названия группы
|
||||
public void UpdateGroup(int groupId, string newGroupName)
|
||||
{
|
||||
ValidateGroupName(newGroupName);
|
||||
var existingGroup = ValidateGroupExistence(groupId);
|
||||
|
||||
existingGroup.Name = newGroupName;
|
||||
_repositoryGroupImpl.UpdateGroup(existingGroup);
|
||||
}
|
||||
}
|
||||
}
|
136
Demo/Domain/UseCase/UserUseCase.cs
Normal file
136
Demo/Domain/UseCase/UserUseCase.cs
Normal file
@ -0,0 +1,136 @@
|
||||
using Demo.Data.Exceptions;
|
||||
using Demo.Data.Repository;
|
||||
using Demo.domain.Models;
|
||||
|
||||
namespace Demo.Domain.UseCase
|
||||
{
|
||||
public class UserUseCase
|
||||
{
|
||||
private readonly UserRepositoryImpl _repositoryUserImpl;
|
||||
private readonly GroupRepositoryImpl _repositoryGroupImpl;
|
||||
|
||||
public UserUseCase(UserRepositoryImpl repositoryImpl, GroupRepositoryImpl repositoryGroupImpl)
|
||||
{
|
||||
_repositoryUserImpl = repositoryImpl;
|
||||
_repositoryGroupImpl = repositoryGroupImpl;
|
||||
}
|
||||
|
||||
// Приватный метод для валидации ФИО пользователя
|
||||
private void ValidateUserFIO(string fio)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fio))
|
||||
{
|
||||
throw new ArgumentException("ФИО не может быть пустым.");
|
||||
}
|
||||
}
|
||||
|
||||
// Приватный метод для валидации существования пользователя по ID
|
||||
private UserLocalEnity ValidateUserExistence(int userId)
|
||||
{
|
||||
var user = _repositoryUserImpl.GetAllUsers
|
||||
.FirstOrDefault(u => u.ID == userId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new Exception("Пользователь не найден.");
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
// Приватный метод для валидации существования группы по ID
|
||||
private GroupLocalEntity ValidateGroupExistence(int groupId)
|
||||
{
|
||||
var group = _repositoryGroupImpl.GetAllGroups()
|
||||
.FirstOrDefault(g => g.Id == groupId);
|
||||
|
||||
if (group == null)
|
||||
{
|
||||
throw new Exception("Группа не найдена.");
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
// Вывести всех пользователей
|
||||
public List<User> GetAllUsers() => _repositoryUserImpl.GetAllUsers
|
||||
.Join(_repositoryGroupImpl.GetAllGroups(),
|
||||
user => user.GroupID,
|
||||
group => group.Id,
|
||||
(user, group) =>
|
||||
new User
|
||||
{
|
||||
ID = user.ID,
|
||||
FIO = user.FIO,
|
||||
Guid = user.Guid,
|
||||
Group = new Group { Id = group.Id, Name = group.Name }
|
||||
}).ToList();
|
||||
|
||||
// Удалить пользователя по id
|
||||
public bool RemoveUserById(int userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _repositoryUserImpl.RemoveUserById(userId);
|
||||
}
|
||||
catch (UserNotFoundException ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
catch (RepositoryException ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка в репозитории: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Обновить пользователя по guid
|
||||
public User UpdateUser(User user)
|
||||
{
|
||||
ValidateUserFIO(user.FIO);
|
||||
ValidateGroupExistence(user.Group.Id);
|
||||
|
||||
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("Ошибка при обновлении пользователя.");
|
||||
}
|
||||
|
||||
var groupEntity = ValidateGroupExistence(result.GroupID);
|
||||
|
||||
return new User
|
||||
{
|
||||
FIO = result.FIO,
|
||||
Guid = result.Guid,
|
||||
Group = new Group
|
||||
{
|
||||
Id = groupEntity.Id,
|
||||
Name = groupEntity.Name
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Найти пользователя по id
|
||||
public User FindUserById(int userId)
|
||||
{
|
||||
var user = ValidateUserExistence(userId);
|
||||
var group = ValidateGroupExistence(user.GroupID);
|
||||
|
||||
return new User
|
||||
{
|
||||
FIO = user.FIO,
|
||||
Guid = user.Guid,
|
||||
Group = new Group { Id = group.Id, Name = group.Name }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
15
Demo/Program.cs
Normal file
15
Demo/Program.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Demo.Data.Repository;
|
||||
using Demo.Domain.UseCase;
|
||||
using Demo.UI;
|
||||
|
||||
GroupRepositoryImpl groupRepositoryImpl = new GroupRepositoryImpl();
|
||||
|
||||
UserRepositoryImpl userRepositoryImpl = new UserRepositoryImpl();
|
||||
|
||||
UserUseCase userUseCase = new UserUseCase(userRepositoryImpl, groupRepositoryImpl);
|
||||
|
||||
GroupUseCase groupUseCase = new GroupUseCase(groupRepositoryImpl);
|
||||
|
||||
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase, groupUseCase);
|
||||
|
||||
mainMenuUI.DisplayMenu();
|
64
Demo/UI/GroupConsole.cs
Normal file
64
Demo/UI/GroupConsole.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class GroupConsoleUI
|
||||
{
|
||||
private readonly GroupUseCase _groupUseCase;
|
||||
|
||||
public GroupConsoleUI(GroupUseCase groupUseCase)
|
||||
{
|
||||
_groupUseCase = groupUseCase;
|
||||
}
|
||||
|
||||
public void FindGroupById(int IdGroup)
|
||||
{
|
||||
_groupUseCase.FindGroupById(IdGroup);
|
||||
}
|
||||
|
||||
// Метод для отображения всех групп
|
||||
public void DisplayAllGroups()
|
||||
{
|
||||
Console.WriteLine("\n=== Список всех групп ===");
|
||||
StringBuilder groupOutput = new StringBuilder();
|
||||
|
||||
foreach (var group in _groupUseCase.GetAllGroups())
|
||||
{
|
||||
groupOutput.AppendLine($"{group.Id}\t{group.Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine(groupOutput);
|
||||
Console.WriteLine("===========================\n");
|
||||
}
|
||||
|
||||
// Метод для добавления новой группы
|
||||
public void AddGroup(string groupName)
|
||||
{
|
||||
try
|
||||
{
|
||||
_groupUseCase.AddGroup(groupName);
|
||||
Console.WriteLine($"\nГруппа {groupName} добавлена.\n");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}\n");
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveGroup(string groupIdStr)
|
||||
{
|
||||
int groupId = int.Parse(groupIdStr);
|
||||
_groupUseCase.RemoveGroupById(groupId);
|
||||
Console.WriteLine($"Группа с ID: {groupId} удалена");
|
||||
}
|
||||
|
||||
// Метод для обновления названия группы
|
||||
public void UpdateGroupName(int groupId, string newGroupName)
|
||||
{
|
||||
_groupUseCase.UpdateGroup(groupId, newGroupName);
|
||||
Console.WriteLine($"\nНазвание группы с ID {groupId} изменено на {newGroupName}.\n");
|
||||
}
|
||||
}
|
||||
}
|
147
Demo/UI/MainMenu.cs
Normal file
147
Demo/UI/MainMenu.cs
Normal file
@ -0,0 +1,147 @@
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class MainMenuUI
|
||||
{
|
||||
private readonly UserConsoleUI _userConsoleUI;
|
||||
private readonly GroupConsoleUI _groupConsoleUI;
|
||||
|
||||
public MainMenuUI(UserUseCase userUseCase, GroupUseCase groupUseCase)
|
||||
{
|
||||
_userConsoleUI = new UserConsoleUI(userUseCase);
|
||||
_groupConsoleUI = new GroupConsoleUI(groupUseCase);
|
||||
}
|
||||
|
||||
public void DisplayMenu()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Console.WriteLine("\n=-= Главное меню =-=\n");
|
||||
|
||||
Console.WriteLine("=-= Команды с Пользователями =-=");
|
||||
Console.WriteLine("1. Вывести всех пользователей");
|
||||
Console.WriteLine("2. Удалить пользователя по id");
|
||||
Console.WriteLine("3. Обновить пользователя по id");
|
||||
Console.WriteLine("4. Найти пользователя по id");
|
||||
Console.WriteLine();
|
||||
|
||||
Console.WriteLine("=-= Команды с Группами =-=");
|
||||
Console.WriteLine("5. Вывести все группы");
|
||||
Console.WriteLine("6. Добавить группу");
|
||||
Console.WriteLine("7. Удалить группу");
|
||||
Console.WriteLine("8. Изменить название группы");
|
||||
Console.WriteLine("9. Поиск группы по ID");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("0. Выход");
|
||||
Console.WriteLine();
|
||||
|
||||
Console.Write("\nВаш выбор: ");
|
||||
string comand = Console.ReadLine();
|
||||
Console.WriteLine();
|
||||
|
||||
switch (comand)
|
||||
{
|
||||
case "1":
|
||||
// Отображение всех пользователей
|
||||
_userConsoleUI.DisplayAllUsers();
|
||||
break;
|
||||
|
||||
case "2":
|
||||
// Удаление пользователя по ID
|
||||
Console.Write("Введите ID пользователя для удаления: ");
|
||||
string inputId = Console.ReadLine();
|
||||
if (int.TryParse(inputId, out int userId))
|
||||
{
|
||||
_userConsoleUI.RemoveUserById(userId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "3":
|
||||
// Обновление пользователя по ID
|
||||
Console.Write("Введите ID пользователя для обновления: ");
|
||||
string updateIdInput = Console.ReadLine();
|
||||
if (int.TryParse(updateIdInput, out int updateUserId))
|
||||
{
|
||||
_userConsoleUI.UpdateUserById(updateUserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "4":
|
||||
// Поиск пользователя по ID
|
||||
Console.Write("Введите ID пользователя для поиска: ");
|
||||
string findIdInput = Console.ReadLine();
|
||||
if (int.TryParse(findIdInput, out int findUserId))
|
||||
{
|
||||
_userConsoleUI.FindUserById(findUserId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID");
|
||||
}
|
||||
break;
|
||||
|
||||
case "5":
|
||||
// Отображение всех групп
|
||||
_groupConsoleUI.DisplayAllGroups();
|
||||
break;
|
||||
|
||||
case "6":
|
||||
// Добавление новой группы
|
||||
Console.Write("Введите название новой группы: ");
|
||||
string newGroupName = Console.ReadLine();
|
||||
_groupConsoleUI.AddGroup(newGroupName);
|
||||
break;
|
||||
|
||||
case "7":
|
||||
// Удаление группы
|
||||
Console.Write("Введите ID группы для удаления: ");
|
||||
string groupIdForDelete=Console.ReadLine();
|
||||
_groupConsoleUI.RemoveGroup(groupIdForDelete);
|
||||
break;
|
||||
|
||||
case "8":
|
||||
// Изменение названия группы
|
||||
Console.Write("Введите ID группы для изменения: ");
|
||||
if (int.TryParse(Console.ReadLine(), out int groupId))
|
||||
{
|
||||
Console.Write("Введите новое название группы: ");
|
||||
string newName = Console.ReadLine();
|
||||
_groupConsoleUI.UpdateGroupName(groupId, newName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Неверный формат ID группы");
|
||||
}
|
||||
break;
|
||||
|
||||
case "9":
|
||||
// Поиск группы
|
||||
Console.Write("Введите ID группы для поиска : ");
|
||||
if(int.TryParse(Console.ReadLine(), out int IdGroup)){
|
||||
_groupConsoleUI.FindGroupById(IdGroup);
|
||||
}
|
||||
break;
|
||||
|
||||
case "0":
|
||||
Console.WriteLine("Выход...");
|
||||
return;
|
||||
|
||||
default:
|
||||
Console.WriteLine("Неверный выбор, попробуйте снова.");
|
||||
break;
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
74
Demo/UI/UserConsole.cs
Normal file
74
Demo/UI/UserConsole.cs
Normal file
@ -0,0 +1,74 @@
|
||||
using Demo.Domain.UseCase;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Demo.UI
|
||||
{
|
||||
public class UserConsoleUI
|
||||
{
|
||||
private readonly UserUseCase _userUseCase;
|
||||
|
||||
public UserConsoleUI(UserUseCase userUseCase)
|
||||
{
|
||||
_userUseCase = userUseCase;
|
||||
}
|
||||
|
||||
// Метод для отображения всех пользователей
|
||||
public void DisplayAllUsers()
|
||||
{
|
||||
Console.WriteLine("\n=== Список всех пользователей ===");
|
||||
StringBuilder userOutput = new StringBuilder();
|
||||
|
||||
foreach (var user in _userUseCase.GetAllUsers())
|
||||
{
|
||||
userOutput.AppendLine($"{user.ID}\t{user.Guid}\t{user.FIO}\t{user.Group.Name}");
|
||||
}
|
||||
|
||||
Console.WriteLine(userOutput);
|
||||
Console.WriteLine("===============================\n");
|
||||
}
|
||||
|
||||
// Метод для удаления пользователя по ID
|
||||
public void RemoveUserById(int userId)
|
||||
{
|
||||
string output = _userUseCase.RemoveUserById(userId) ? "Пользователь удален" : "Пользователь не найден";
|
||||
Console.WriteLine($"\n{output}\n");
|
||||
}
|
||||
|
||||
// Метод для обновления пользователя по ID
|
||||
public void UpdateUserById(int userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var user = _userUseCase.FindUserById(userId);
|
||||
|
||||
Console.WriteLine($"Текущие данные: {user.FIO}, {user.Group.Name}");
|
||||
Console.Write("\nВведите новое ФИО: ");
|
||||
string newFIO = Console.ReadLine();
|
||||
|
||||
user.FIO = newFIO;
|
||||
_userUseCase.UpdateUser(user);
|
||||
|
||||
Console.WriteLine("\nПользователь обновлен.\n");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Ошибка: {ex.Message}\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Метод для поиска пользователя по ID
|
||||
public void FindUserById(int userId)
|
||||
{
|
||||
var user = _userUseCase.FindUserById(userId);
|
||||
if (user != null)
|
||||
{
|
||||
Console.WriteLine($"\nПользователь найден: {user.Guid}, {user.FIO}, {user.Group.Name}\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("\nПользователь не найден.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
Demo/bin/Debug/net8.0/Demo.deps.json
Normal file
23
Demo/bin/Debug/net8.0/Demo.deps.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"Demo/1.0.0": {
|
||||
"runtime": {
|
||||
"Demo.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Demo/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
BIN
Demo/bin/Debug/net8.0/Demo.dll
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.dll
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Demo.exe
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.exe
Normal file
Binary file not shown.
BIN
Demo/bin/Debug/net8.0/Demo.pdb
Normal file
BIN
Demo/bin/Debug/net8.0/Demo.pdb
Normal file
Binary file not shown.
12
Demo/bin/Debug/net8.0/Demo.runtimeconfig.json
Normal file
12
Demo/bin/Debug/net8.0/Demo.runtimeconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
23
Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs
Normal file
23
Demo/obj/Debug/net8.0/Demo.AssemblyInfo.cs
Normal file
@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
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+6be91a3daa12e11afafcb7bfa8a381851a1c6d13")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Demo")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Demo")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Создано классом WriteCodeFragment MSBuild.
|
||||
|
1
Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache
Normal file
1
Demo/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache
Normal file
@ -0,0 +1 @@
|
||||
597fa958725b79051cce88e5b66d8ff3029ce88e040c90e31a5a5829fb266be4
|
@ -0,0 +1,13 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = Demo
|
||||
build_property.ProjectDir = C:\Users\adm\source\repos\presence_new\Demo\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
8
Demo/obj/Debug/net8.0/Demo.GlobalUsings.g.cs
Normal file
8
Demo/obj/Debug/net8.0/Demo.GlobalUsings.g.cs
Normal file
@ -0,0 +1,8 @@
|
||||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.IO;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Net.Http;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
BIN
Demo/obj/Debug/net8.0/Demo.assets.cache
Normal file
BIN
Demo/obj/Debug/net8.0/Demo.assets.cache
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
ed5a8c36a17dc0ce1f0584a54124cf9ca5fb6a4c72ce3bba4b5a671138ebee45
|
14
Demo/obj/Debug/net8.0/Demo.csproj.FileListAbsolute.txt
Normal file
14
Demo/obj/Debug/net8.0/Demo.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,14 @@
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\bin\Debug\net8.0\Demo.exe
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\bin\Debug\net8.0\Demo.deps.json
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\bin\Debug\net8.0\Demo.runtimeconfig.json
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\bin\Debug\net8.0\Demo.dll
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\bin\Debug\net8.0\Demo.pdb
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.GeneratedMSBuildEditorConfig.editorconfig
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.AssemblyInfoInputs.cache
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.AssemblyInfo.cs
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.csproj.CoreCompileInputs.cache
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.dll
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\refint\Demo.dll
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.pdb
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\Demo.genruntimeconfig.cache
|
||||
C:\Users\adm\Source\Repos\presence_new\Demo\obj\Debug\net8.0\ref\Demo.dll
|
BIN
Demo/obj/Debug/net8.0/Demo.dll
Normal file
BIN
Demo/obj/Debug/net8.0/Demo.dll
Normal file
Binary file not shown.
1
Demo/obj/Debug/net8.0/Demo.genruntimeconfig.cache
Normal file
1
Demo/obj/Debug/net8.0/Demo.genruntimeconfig.cache
Normal file
@ -0,0 +1 @@
|
||||
9b1e2cf713fac6b5af6fdc748e02588a118e0108e8af9c39763b31b5c1f122c1
|
BIN
Demo/obj/Debug/net8.0/Demo.pdb
Normal file
BIN
Demo/obj/Debug/net8.0/Demo.pdb
Normal file
Binary file not shown.
BIN
Demo/obj/Debug/net8.0/apphost.exe
Normal file
BIN
Demo/obj/Debug/net8.0/apphost.exe
Normal file
Binary file not shown.
BIN
Demo/obj/Debug/net8.0/ref/Demo.dll
Normal file
BIN
Demo/obj/Debug/net8.0/ref/Demo.dll
Normal file
Binary file not shown.
BIN
Demo/obj/Debug/net8.0/refint/Demo.dll
Normal file
BIN
Demo/obj/Debug/net8.0/refint/Demo.dll
Normal file
Binary file not shown.
68
Demo/obj/Demo.csproj.nuget.dgspec.json
Normal file
68
Demo/obj/Demo.csproj.nuget.dgspec.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"C:\\Users\\adm\\source\\repos\\presence_new\\Demo\\Demo.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"C:\\Users\\adm\\source\\repos\\presence_new\\Demo\\Demo.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\adm\\source\\repos\\presence_new\\Demo\\Demo.csproj",
|
||||
"projectName": "Demo",
|
||||
"projectPath": "C:\\Users\\adm\\source\\repos\\presence_new\\Demo\\Demo.csproj",
|
||||
"packagesPath": "C:\\Users\\adm\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\adm\\Source\\Repos\\presence_new\\Demo\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\adm\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.400/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
15
Demo/obj/Demo.csproj.nuget.g.props
Normal file
15
Demo/obj/Demo.csproj.nuget.g.props
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\adm\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\adm\.nuget\packages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
2
Demo/obj/Demo.csproj.nuget.g.targets
Normal file
2
Demo/obj/Demo.csproj.nuget.g.targets
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
73
Demo/obj/project.assets.json
Normal file
73
Demo/obj/project.assets.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
"net8.0": {}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
"net8.0": []
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\adm\\.nuget\\packages\\": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\adm\\Source\\Repos\\presence_new\\Demo\\Demo.csproj",
|
||||
"projectName": "Demo",
|
||||
"projectPath": "C:\\Users\\adm\\Source\\Repos\\presence_new\\Demo\\Demo.csproj",
|
||||
"packagesPath": "C:\\Users\\adm\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\adm\\Source\\Repos\\presence_new\\Demo\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\adm\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net8.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "direct"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.400/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
Demo/obj/project.nuget.cache
Normal file
8
Demo/obj/project.nuget.cache
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "+PcSJ/mMOPQ=",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\adm\\source\\repos\\presence_new\\Demo\\Demo.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
Loading…
Reference in New Issue
Block a user