MVC 5与asp.net身份2.0
我了解如何获取当前登录的用户ID.我需要获取系统中不同用户的用户ID.这是怎么做到的?
防爆.我需要获取用户名"fsmith"的用户ID ...
Xamarin 开发新手!使用 Visual Studio 2017 以及适用于我的开发环境的所有最新安装和更新。
我有我的应用程序“shell”工作,它将运行、导航、crud 到本地数据库,并同步到休息服务。所以,我的应用程序的基础是健全的。我正在尝试将 ZXing 条码扫描器集成到我的应用程序中。我能找到的大部分帮助都与 xaml 背后的原始表单或代码有关。我正在使用视图和视图模型,但我不知道如何将我找到的信息转换为该模型。
我目前的 xaml 视图在单击按钮时显示“相机查看器”,因此我可以使用相机查看条形码。但是,相机视图中没有“红线”,随后也没有触发事件让我知道发生了什么。我真的很困惑,因为我对 Xamarin 很陌生。我不知道从哪里开始。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
xmlns:fe="clr-namespace:FreshEssentials;assembly=FreshEssentials"
xmlns:forms="clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms"
prism:ViewModelLocator.AutowireViewModel="True"
x:Class="Views.InventoryPage1"
Title="Inventory Page">
<StackLayout Spacing="5" Padding="10,10,10,0">
<!--<fe:BindablePicker ItemsSource="{Binding Areas}" SelectedItem="{Binding SelectedArea}" DisplayProperty="AreaName" Title="Select Your Area" />
<fe:BindablePicker ItemsSource="{Binding Reasons}" SelectedItem="{Binding SelectedReason}"
DisplayProperty="Description" Title="Select a Reason" />
<Label Text="Scan"/>
<Entry Text="{Binding Barcode}"/>
<Label Text="Quantity"/>
<Entry Text="{Binding Quantity}"/>
<Button Text="Save" Style="{StaticResource Button_Primary}" Command="{Binding SaveCommand}" />-->
<forms:ZXingScannerView WidthRequest="100" HeightRequest="100" IsScanning="{Binding IsScanning}" IsAnalyzing="{Binding IsAnalyzing}" …Run Code Online (Sandbox Code Playgroud) 我只是升级了 Xamarin Forms 和 Prism,现在我的 app.xaml.cs 文件中有一堆错误,用于所有 Unity 注册。此外,正如 Brian 在更新说明中所述,所有 Unity 命名空间也已损坏。对于下面的小片段,新的 RegisterTypes 方法应该是什么样的,容器类型列表中的 1 应该是什么样的?
这个片段曾经有效:
protected override void RegisterTypes()
{
Container.RegisterType<ISession, SQLiteSession>(new ContainerControlledLifetimeManager());
Container.RegisterType<IConfiguration, Configuration>();
Container.RegisterType<IAuthenticationRestClient, AuthenticationRestClient>();
Run Code Online (Sandbox Code Playgroud)
现在看起来它需要看起来像:
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterType<ISession, SQLiteSession>(new ContainerControlledLifetimeManager());
Container.RegisterType<IConfiguration, Configuration>();
Container.RegisterType<IAuthenticationRestClient, AuthenticationRestClient>();
Run Code Online (Sandbox Code Playgroud)