Demo/Domain/Models/User.cs

27 lines
785 B
C#
Raw Normal View History

2024-10-17 11:46:19 +00:00
namespace Demo.Domain.Models
{
public class User
{
public required string FIO{get; set; }
public Guid Guid{get; set; }
public required Group Group{get; set; }
public static User Parse(string input){
string[] words = input.Split(" ");
// return new Group{ID = Convert.ToInt32(words[0]), Name = words[1]};
foreach (string element in words){
Console.Write(element + " ");
}
return new User
{
FIO = words[0],
Guid = Guid.Parse(words[1]),
Group = new Group
{
ID = Convert.ToInt32(words[2]),
Name = words[3]
}
};
}
}
}