using System; using System.Collections.Generic; using System.Linq; using AvaloniaExample.Models; using Microsoft.EntityFrameworkCore; using ReactiveUI; namespace AvaloniaExample.ViewModels { public class UserProfileViewModel : ReactiveObject { UsersContext connect; Login userInf; public Login UserInf { get => userInf; set => this.RaiseAndSetIfChanged(ref userInf, value); } public List GenderList => new List{ "мужчина", "женщина" }; //public string Gender { get => UserInf.UsersInfo.Gender; set => UserInf.UsersInfo.Gender =value; } public UserProfileViewModel(UsersContext dbConnect, string userLogin) { connect = dbConnect; userInf = connect.Logins.Include(x => x.UsersInfo).FirstOrDefault(x => x.Value == userLogin); } public string DateBirth { get => userInf.UsersInfo.DateBirth.ToString(); set => userInf.UsersInfo.DateBirth = DateOnly.FromDateTime(DateTime.Parse(value)); } } }