Demo/Domain/Models/User.cs
2024-10-17 14:46:19 +03:00

27 lines
785 B
C#

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]
}
};
}
}
}