12345678910111213141516171819202122232425 |
- 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<string> GenderList => new List<string>{ "ìóæ÷èíà", "æåíùèíà" };
- //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)); }
-
- }
- }
|