本文整理汇总了C#中UserService.SaveUser方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.SaveUser方法的具体用法?C# UserService.SaveUser怎么用?C# UserService.SaveUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService.SaveUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserService_SaveUser_UpdatesAUser
public void UserService_SaveUser_UpdatesAUser()
{
_session = A.Fake<ISession>();
_userService = new UserService(_session, _siteSettings);
var user = new User();
_userService.SaveUser(user);
A.CallTo(() => _session.Update(user)).MustHaveHappened();
}
示例2: BtnConnectWithFacebook_TouchUpInside
async partial void BtnConnectWithFacebook_TouchUpInside(UIButton sender)
{
try
{
string facebookToken;
var auth = new OAuth2Authenticator(
clientId: BeerDrinkin.Core.Helpers.Keys.FacebookClientId,
scope: "",
authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri("https://beerdrinkin.azure-mobile.net/signin-facebook"));
auth.AllowCancel = true;
auth.Completed += (s, e) =>
{
if (!e.IsAuthenticated)
{
Acr.UserDialogs.UserDialogs.Instance.ShowError("Not authorized");
return;
}
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me"), null, e.Account);
var response = request.GetResponseAsync().ContinueWith(t =>
{
if (!t.IsFaulted && !t.IsCanceled)
{
var stri = t.Result.GetResponseText();
var profile = JsonConvert.DeserializeObject<FacebookUser>(stri);
var userItem = new UserItem();
userItem.FirstName = profile.FirstName;
userItem.LastName = profile.LastName;
userItem.Email = profile.Email;
}
});
};
await PresentViewControllerAsync(auth.GetUI(), true);
// Client.Instance.BeerDrinkinClient.CurrenMobileServicetUser = await Client.Instance.BeerDrinkinClient.ServiceClient.LoginAsync()
var userService = new UserService();
await userService.SaveUser(Client.Instance.BeerDrinkinClient.CurrenMobileServicetUser);
}
catch (Exception ex)
{
Acr.UserDialogs.UserDialogs.Instance.ShowError($"ERROR - AUTHENTICATION FAILED {ex.Message}");
}
}