Пакеты Microsoft.EntityFrameworkCore.Proxies Microsoft.EntityFrameworkCore.Tools Pomelo.EntityFrameworkCore.MySql Подключение dotnet tool install --global dotnet-ef --version 5.0.0 cd ./WpfApp6 dotnet ef dbcontext scaffold "server=localhost;user=root;password=2580;database=trade" "Pomelo.EntityFrameworkCore.MySql" --output-dir Models using название проекта.Models; Models context public static sakilaContext context { get; } = new sakilaContext(); public static CafeManagementContext _context; public static CafeManagementContext GetContext() { if (_context == null) _context = new CafeManagementContext(); return _context; } Models User public string FIO { get { Employee emp = App.context.Employees.ToList().Find(u => u.UserId == UserId); return $"{emp.FirstName} {emp.LastName}"; } } public string Id { get { Employee emp = App.context.Employees.ToList().Find(u => u.UserId == UserId); return $"{emp.EmployeeId}"; } } public string dolgnost { get { return $"{Role}"; } } Alldata cs internal class AllData { public static int ID; } Авторизация xaml Title="Авторизация" Height="498" Width="384" FontSize="20" WindowStartupLocation="CenterScreen"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="338*"/> <ColumnDefinition Width="31*"/> </Grid.ColumnDefinitions> <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Background="#FF8CFD93" Grid.ColumnSpan="2" Margin="15,0,0,0"> <Image Height="203" Width="194" Source="/Images/free-icon-cafe-1223041.png" /> <Label/> <StackPanel Orientation="Horizontal"> <TextBlock Width="80" >Логин:</TextBlock> <Label/> <TextBox x:Name="Login" Width="250" /> </StackPanel> <Label/> <StackPanel Orientation="Horizontal"> <TextBlock Width="80">Пароль:</TextBlock> <Label/> <PasswordBox x:Name="Password" Visibility="Collapsed" Width="250" /> <TextBox x:Name="Password2" Visibility="Collapsed" Width="250" TextChanged="Password2_TextChanged"/> </StackPanel> <Label/> <StackPanel Orientation="Horizontal"> <Label Width="76"/> <CheckBox x:Name="Safety" Checked="Safety_Checked" Unchecked="Safety_Unchecked">Показать/Скрыть пароль</CheckBox> </StackPanel> <Label/> <Button x:Name="Enter" Background="#FF5687FF" Click="Enter_Click">Войти</Button> <Label/> <Button x:Name="Exit" Background="#FF5687FF" Click="Exit_Click">Выход</Button> </StackPanel> </Grid>
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Apr 16, 2024
$ dotnet add package lastNo README available.