private async Task <DialogTurnResult> ValidateUserStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var choice = (FoundChoice)stepContext.Result; var permission = choice.Value.GetValueFromDescription <PermissionLevels>(); var prestashopId = stepContext.GetValue <int>("id"); //If the user already asked for permission if (await UserController.CheckForUserProfileAsync(prestashopId)) { await UserController.ValidateUserAsync(prestashopId, (int)permission); await NotifyController.NotifyValidation(prestashopId); } //If we're validating the user ahead of his first login else { var profile = new Models.UserProfile() { Permission = (int)permission, PrestashopId = prestashopId, Validated = true }; await UserController.AddUserAsync(profile); } await stepContext.Context.SendActivityAsync(MessageFactory.Text( "A new user has been added. He can now login and start using Greta!"), cancellationToken); return(await stepContext.EndDialogAsync(null, cancellationToken)); }
public ActionResult Profile(Models.UserProfile user) { //logged in user email string email = User.Identity.Name; if (User.Identity.IsAuthenticated) { if (ModelState.IsValid) { if (user.UpdateProfile(email, user.FirstName, user.LastName, user.Street, user.City, user.State, user.Country, user.PhoneNumber, user.Experience_Years, user.Skills)) { //update successful FormsAuthentication.SetAuthCookie(User.Identity.Name, true); TempData["success"] = "Profile successfully updated!"; return(RedirectToAction("Profile", "User")); } else { //update failed //invalid data in one or more fields //TempData["success"] = null; ModelState.AddModelError("", "Registration data is incorrect!"); } } return(View(user)); } else { //user not authenticated return(RedirectToAction("Login", "User")); } }
public ActionResult ExternalLoginConfirmation(RegisterExternalLoginModel model, string returnUrl) { string provider = null; string providerUserId = null; if (User.Identity.IsAuthenticated || !OAuthWebSecurity.TryDeserializeProviderUserId(model.ExternalLoginData, out provider, out providerUserId)) { return(RedirectToAction("Manage")); } if (ModelState.IsValid) { // Insert a new user into the database using (UsersContext db = new UsersContext()) { Models.UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower()); // Check if user already exists if (user == null) { // Insert name into the profile table db.UserProfiles.Add(new Models.UserProfile { UserName = model.UserName }); db.SaveChanges(); OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, model.UserName); OAuthWebSecurity.Login(provider, providerUserId, createPersistentCookie: false); return(RedirectToLocal(returnUrl)); } else { ModelState.AddModelError("UserName", "User name already exists. Please enter a different user name."); } } } return(View(model)); }
private static void Validate(Models.UserProfile userProfile) { if (userProfile.Password1 != userProfile.Password2) { throw new Exception(Localization.GetExceptionText("InvalidChangePassword.Error", "Passwords don't match.")); } }
public ActionResult Subject(int id, string sId) { var subject = Models.MySubjectViewModel.GetSubjectByStudentIdById(sId, id); if (subject.Id == null) { return(RedirectToAction("Subjects")); } else { var Modules = Models.Module.GetModulesBySubjectId(subject.Id); foreach (var item in Modules) { foreach (var day in item.ModuleDays) { foreach (var lesson in day.Lessons) { lesson.Passed = Models.Progress.GetProgressByLessonId(sId, Convert.ToInt32(lesson.Id)).Passed; } } } ViewBag.Modules = Modules; var Teacher = new Models.UserProfile(subject.TeacherId); ViewBag.Teacher = Teacher; return(View(subject)); } }
public GStoreEFDbContext(string userName, StoreFront cachedStoreFront, StoreFrontConfiguration cachedstoreFrontConfig, UserProfile cachedUserProfile) : base("name=GStoreWeb.Properties.Settings.GStoreDB") { this.UserName = userName; this.CachedStoreFront = cachedStoreFront; this.CachedStoreFrontConfig = cachedstoreFrontConfig; this.CachedUserProfile = cachedUserProfile; }
public ListContext(string userName, Models.StoreFront cachedStoreFront, Models.StoreFrontConfiguration cachedStoreFrontConfig, Models.UserProfile cachedUserProfile) { UserName = userName; CachedStoreFront = cachedStoreFront; CachedStoreFrontConfig = cachedStoreFrontConfig; CachedUserProfile = cachedUserProfile; CreateRepositories(); }
public Models.UserProfile GetValues(Models.User.GetUserDetails userObj) { try { Models.UserProfile obUser = new Models.UserProfile(); //we create an instance of user profile Models.User.GetUserDetails.auth_verifier = userObj.auth_verifierInstance; //get the auth_verifier from url Flickr f = Models.FlickrManager.GetInstance(); OAuthRequestToken requestToken = Authentication.FullToken as OAuthRequestToken; //apelez metoda pentru a prelua datele asociate userului conectat OAuthAccessToken accessToken = f.OAuthGetAccessToken(requestToken, Models.User.GetUserDetails.auth_verifier); // Models.UpdateComments.Update(f); if (!Models.User.FlickerObj.UserFl.ContainsKey(accessToken.UserId)) { Models.User.FlickerObj.UserFl.Add(accessToken.UserId, f); } try { var result = (from t in db.users where t.UserId == accessToken.UserId select t).SingleOrDefault(); if (result == null) // nu exista in DB? Insert user in DB { //var userProfile = f.PeopleFindByUserName(accessToken.Username);//iau datele dupa username obUser.userId = accessToken.UserId; obUser.userName = accessToken.Username.ToString(); obUser.fullName = accessToken.FullName; user newUser = new user() { UserId = accessToken.UserId, UserName = obUser.userName, Full_Name = obUser.fullName }; db.users.Add(newUser); db.SaveChanges(); f = null; return(obUser); } else //daca exista in DB, preiau datele si le returnez { var ob = db.users.Where(idx => idx.UserId == accessToken.UserId).First(); obUser.userId = ob.UserId; obUser.userName = ob.UserName.ToString(); obUser.fullName = ob.Full_Name; f = null; return(obUser); } } catch (Exception) { var ob = db.users.Where(idx => idx.UserId == accessToken.UserId).First(); obUser.userId = ob.UserId; obUser.userName = ob.UserName.ToString(); obUser.fullName = ob.Full_Name; f = null; return(obUser); } } catch (Exception) { return(null); } }
// GET: UserProfile public ActionResult GetPropertiesForUser() { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); Models.UserProfile userProfile = Cache.UserProfile.GetUserProfile(ClaimsPrincipal.Current.Identities.First().Name); stopWatch.Stop(); ViewData["EllapsedTime"] = stopWatch.ElapsedMilliseconds; return(PartialView(userProfile)); }
public async Task AddUserAsync(Models.UserProfile userProfile) { using (var context = ServiceProvider.CreateScope()) { var db = context.ServiceProvider.GetRequiredService <GretaDBContext>(); db.Add(userProfile); await db.SaveChangesAsync(); } }
public ICollection <AspNetIdentityUserLogin> AspNetIdentityUserLogins(Models.UserProfile userProfile) { Identity.AspNetIdentityUser user = AspNetIdentityUser(userProfile); if (user == null) { return(null); } return(user.Logins); }
private async Task MessageReceived(IDialogContext context, IAwaitable <IMessageActivity> argument) { var message = await argument; var userprofile = context.GetProfile(); if (userprofile == null || string.IsNullOrWhiteSpace(userprofile.AccessToken)) { if (message.Text.StartsWith("token:")) { var token = message.Text.Remove(0, "token:".Length); var validtoken = await SitecoreAuthenticationAPI.Instance().ValidateAccessToken(token); if (validtoken) { var profile = await SitecoreUserManagementAPI.Instance(token).GetProfile(); userprofile = new Models.UserProfile { AccessToken = token, FullName = profile.FullName, Login = profile.UserName, IsAdministrator = profile.IsAdministrator, Roles = profile.Roles, ApplicationInsights = profile.ApplicationInsights }; context.SetProfile(userprofile); context.Done(context.GetUnauthorizedMessageText()); return; } } await context.PostAsync("Hi I'm Sitecore Bot! I don't really know who you are, so you have to show me some proof!"); await LogIn(context); context.Wait(MessageReceived); return; } var authenticated = await userprofile.IsAuthenticated(); if (!authenticated) { userprofile.AccessToken = null; context.SetProfile(userprofile); await context.PostAsync("Okay, I don't really remember who you were, could you please identify yourself?"); await LogIn(context); context.Wait(MessageReceived); return; } return; }
public static Models.UserProfile GetUserProfile(this AspNetIdentityUser user, IGstoreDb GStoreDb, bool throwExceptionIfNotFound = false) { Models.UserProfile profile = GStoreDb.UserProfiles.SingleOrDefault(up => up.UserId == user.Id); if (throwExceptionIfNotFound && profile == null) { throw new ApplicationException("Cannot find user profile for user id: " + user.Id + "\n\tEmail: " + user.Email + "\n\tUserName: " + user.UserName); } return(profile); }
public ActionResult UserProfile() { var emailid = User.Identity.Name.ToString(); Users obj = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); var isnew = dbobj.UserProfile.Where(x => x.UserID == obj.ID).FirstOrDefault(); if (isnew == null) // For new user { Models.UserProfile upobj = new Models.UserProfile(); upobj.UserID = obj.ID; upobj.FirstName = obj.FirstName; upobj.LastName = obj.LastName; upobj.EmailID = obj.EmailID; ViewBag.CountryCode = new SelectList(dbobj.Countries, "CountryCode", "CountryCode"); ViewBag.CountryName = new SelectList(dbobj.Countries, "ID", "Name"); ViewBag.ProfilePicture = dbobj.UserProfile.Where(x => x.UserID == obj.ID).Select(x => x.ProfilePicture).FirstOrDefault(); return(View(upobj)); } else { UserProfile oldupobj = dbobj.UserProfile.Where(x => x.UserID == obj.ID).FirstOrDefault(); Models.UserProfile editupobj = new Models.UserProfile(); editupobj.UserID = obj.ID; editupobj.FirstName = obj.FirstName; editupobj.LastName = obj.LastName; editupobj.EmailID = obj.EmailID; editupobj.DateOfBirth = oldupobj.DOB; editupobj.Gender = dbobj.ReferenceData.Where(x => x.ID == oldupobj.Gender).Select(x => x.ID).FirstOrDefault(); editupobj.CountryCode = oldupobj.PhoneNumberCountryCode; editupobj.PhoneNumber = oldupobj.PhoneNumber; //editupobj.ProfilePicture = oldupobj.ProfilePicture; editupobj.AddressLine1 = oldupobj.AddressLine1; editupobj.AddressLine2 = oldupobj.AddressLine2; editupobj.City = oldupobj.City; editupobj.State = oldupobj.State; editupobj.ZipCode = oldupobj.ZipCode; editupobj.CountryID = oldupobj.Country; editupobj.University = oldupobj.University; editupobj.College = oldupobj.College; ViewBag.CountryCode = new SelectList(dbobj.Countries, "CountryCode", "CountryCode"); ViewBag.CountryName = new SelectList(dbobj.Countries, "ID", "Name"); ViewBag.ProfilePicture = dbobj.UserProfile.Where(x => x.UserID == obj.ID).Select(x => x.ProfilePicture).FirstOrDefault(); return(View(editupobj)); } }
public ActionResult Login(Models.UserProfile model, string returnUrl) { if (model.IsValid(model.UserName, model.Password)) { FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); return(RedirectToLocal(returnUrl)); } else { ModelState.AddModelError("", "Login data is incorrect!"); } return(RedirectToLocal(returnUrl)); }
public static bool SaveUserProfile(Models.UserProfile userProfile) { Validate(userProfile); //cloning user so cached dies not get changed until actual save occurs var user = GetUserById(userProfile.Id, true); //todo: mapping here or in object? user.Name = userProfile.Name; user.Email = userProfile.Email; user.Locale = userProfile.Locale; user.Password = userProfile.Password1; return(!string.IsNullOrEmpty(SaveUser(user, userProfile.Id))); //at the point of calling the Account service we should have already validated user has permission to change this user id }
public Models.User Create(string username, string password, Models.UserProfile profile, DateTime?created = null) { var user = new User() { Username = username, Password = Crypto.HashPassword(password), DateCreated = created.HasValue ? created.Value : DateTime.Now, Profile = profile }; _users.Create(user); _context.SaveChanges(); return(user); }
public void Test01_RegisterTest() { var result = _profile.Register( new Models.UserProfile() { Name = "Foo", UserID = "1010101", ProfileImageURL = "http://foo.com/foo.jpg" }).GetAwaiter().GetResult(); newUser = result; Assert.IsNotNull(result); }
public async Task Test01_RegisterTest() { var result = await _profile.RegisterAsync( new Models.UserProfile() { Name = "Foo", UserID = "1010101", ProfileImageURL = "http://foo.com/foo.jpg" }); newUser = new Models.UserProfile() { Id = result.Id, Name = result.Name, ProfileImageURL = result.ProfileImageURL, UserID = result.UserID }; Assert.IsNotNull(result); }
public static Models.UserProfile GetUserProfile(string name) { IDatabase cache = CacheConnectionHelper.Connection.GetDatabase(); Models.UserProfile userProfile = (Models.UserProfile)cache.Get(name); if (userProfile == null) { #region Get User Profile from AD Uri serviceRoot = new Uri(SettingsHelper.AzureAdGraphApiEndPoint); var token = AppToken.GetAppToken(); ActiveDirectoryClient adClient = new ActiveDirectoryClient( serviceRoot, async() => await AppToken.GetAppTokenAsync()); string userObjectID = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value; Microsoft.Azure.ActiveDirectory.GraphClient.Application app = (Microsoft.Azure.ActiveDirectory.GraphClient.Application)adClient.Applications.Where( a => a.AppId == SettingsHelper.ClientId).ExecuteSingleAsync().Result; if (app == null) { throw new ApplicationException("Unable to get a reference to application in Azure AD."); } string requestUrl = string.Format("https://graph.windows.net/{0}/users/{1}?api-version=1.5", SettingsHelper.Tenant, name); HttpClient hc = new HttpClient(); hc.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token); HttpResponseMessage hrm = hc.GetAsync(new Uri(requestUrl)).Result; if (hrm.IsSuccessStatusCode) { Models.UserProfile currentUserProfile = JsonConvert.DeserializeObject <Models.UserProfile>(hrm.Content.ReadAsStringAsync().Result); cache.Set(ClaimsPrincipal.Current.Identities.First().Name, currentUserProfile, TimeSpan.FromMinutes(SettingsHelper.CacheUserProfileMinutes)); return(currentUserProfile); } else { return(null); } #endregion } else { return(userProfile); } }
private async Task <DialogTurnResult> CheckUserProfileStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var customer = stepContext.GetValue <Customer>(CUSTOMER); //UserProfile already exists, check if it's validated. if (await UserController.CheckForUserProfileAsync(customer.Id)) { if (await CheckForValidationAsync(customer.Id)) { await UserController.UpdateBotId(customer.Id, stepContext.Context.Activity.From.Id); await stepContext.Context.SendActivityAsync("Login Successful"); return(await stepContext.EndDialogAsync(true, cancellationToken)); } } //User profile doesn't exist, create one and ask for validation. else { var profile = new Models.UserProfile { PrestashopId = customer.Id, BotUserId = stepContext.Context.Activity.From.Id, Validated = false }; await UserController.AddUserAsync(profile); } var promptOptions = new PromptOptions { Prompt = MessageFactory.Text("Mmmm... I see your profile is not validated yet. You want me to contact " + "a member of our staff so they can validate it for you?"), RetryPrompt = MessageFactory.Text("Your profile is not validated yet, would you like to ask for validation? (Yes/No)") }; return(await stepContext.PromptAsync(nameof(ConfirmPrompt), promptOptions, cancellationToken)); }
public Models.UserProfile GetUserProfile(int userLoginId) { var userProfile = new Models.UserProfile(); var user = _userManager.GetUser(userLoginId); if (user != null) { userProfile.user = user; userProfile.UserEducationDetail = _userEducationDetailsManager.GetUserEducationDetails(user.UserID); userProfile.UserLanguages = Helper.XMLStringToList(userProfile.user.LanguagesSpoken, Constants.LanguagesElementName); userProfile.UserFieldOfInterest = Helper.XMLStringToList(userProfile.user.FieldOfInterest, Constants.FieldOfInterestsElementName); } else { userProfile.user = _userManager.GetNewUser(userLoginId); var userLogin = _userLoginManager.GetUserLogin(userLoginId); if (userLogin.IsFacebookLogin == true) { string userFacebookData = FaceBookConnect.Fetch("me"); FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize<FaceBookUser>(userFacebookData); faceBookUser.PictureUrl = string.Format(Constants.FaceBookPictureURLFormat, faceBookUser.Id); userProfile.user.FirstName = faceBookUser.First_Name; userProfile.user.MiddleName = faceBookUser.Middle_Name; userProfile.user.LastName = faceBookUser.Last_Name; userProfile.user.UserPhoto = faceBookUser.PictureUrl; _userManager.AddUser(userProfile.user); } userProfile.UserEducationDetail = new List<UserEducationDetail>(); userProfile.UserFieldOfInterest = new List<int>(); userProfile.UserLanguages = new List<int>(); } return userProfile; }
public async Task <Models.UserProfile> Post([FromBody] Models.UserProfile userProfile) { return(await profileManager.Register(userProfile)); }
public static Models.UserProfile GetUserProfile(string userName) { var userProfile = new Models.UserProfile(); try { using (var connection = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["MasonMaster"].ConnectionString)) { connection.Open(); using (var command = connection.CreateCommand()) { command.CommandText = string.Format("Select * from vwUserProfile Where UserName = '******'", userName); var reader = command.ExecuteReader(); if (reader.HasRows) { reader.Read(); //userProfile.UserId = (int)reader["UserId"]; userProfile.UserName = reader["UserName"].ToString(); userProfile.FullName = reader["FullName"].ToString(); userProfile.LodgeName = reader["LodgeName"].ToString(); //userProfile.PersonId = reader["PersonId"].ToString(); //userProfile.LodgeId = (int)reader["LodgeId"]; userProfile.DatabaseName = reader["DatabaseName"].ToString(); } } } } catch (Exception ex) { userProfile.FullName = ex.Message; } return userProfile; }
public async Task <bool> Put([FromBody] Models.UserProfile userProfile) { return(await profileManager.Update(userProfile)); }
public IGstoreDb NewContext(string userName, Models.StoreFront cachedStoreFront, Models.StoreFrontConfiguration cachedStoreFrontConfig, Models.UserProfile cachedUserProfile) { //use same context for all lists until commit and separate contexts are coded return(new ListContext(userName, cachedStoreFront, cachedStoreFrontConfig, cachedUserProfile)); }
public async Task AddUser(Models.UserProfile profile) { await using var con = GetConnection(); await con.ExecuteAsync("EXEC dbo.AddUser @Id", profile); }
public static void SetProfile(this IDialogContext context, Models.UserProfile profile) { context.PrivateConversationData.SetValue(ContextConstants.UserProfileKey, profile); }
public ActionResult UserProfile(Models.UserProfile model) { var emailid = User.Identity.Name.ToString(); Users obj = dbobj.Users.Where(x => x.EmailID == emailid).FirstOrDefault(); if (ModelState.IsValid) { var isnew = dbobj.UserProfile.Where(x => x.UserID == obj.ID).FirstOrDefault(); if (isnew == null) // For new user { UserProfile upobj = new UserProfile(); upobj.UserID = obj.ID; upobj.DOB = model.DateOfBirth; upobj.Gender = model.Gender; upobj.PhoneNumberCountryCode = model.CountryCode; upobj.PhoneNumber = model.PhoneNumber; upobj.AddressLine1 = model.AddressLine1; upobj.AddressLine2 = model.AddressLine2; upobj.City = model.City; upobj.State = model.State; upobj.ZipCode = model.ZipCode; upobj.Country = model.CountryID; upobj.University = model.University; upobj.College = model.College; upobj.CreatedDate = DateTime.Now; upobj.CreatedBy = obj.ID; upobj.IsActive = true; string path = Path.Combine(Server.MapPath("~/Members"), obj.ID.ToString()); //Checking for directory if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } //Saving Profile Picture if (model.ProfilePicture != null && model.ProfilePicture.ContentLength > 0) { var ProfilePicture = DateTime.Now.ToString().Replace(':', '-').Replace(' ', '_') + Path.GetExtension(model.ProfilePicture.FileName); var ImageSavePath = Path.Combine(Server.MapPath("~/Members/" + obj.ID + "/") + "DP_" + ProfilePicture); model.ProfilePicture.SaveAs(ImageSavePath); upobj.ProfilePicture = Path.Combine(("Members/" + obj.ID + "/"), "DP_" + ProfilePicture); dbobj.SaveChanges(); } else { /*upobj.ProfilePicture = "Default/User.jpg";*/ upobj.ProfilePicture = dbobj.SystemConfigurations.Where(x => x.Key == "DefaultProfilePicture").Select(x => x.Value).ToString(); dbobj.SaveChanges(); } dbobj.UserProfile.Add(upobj); dbobj.SaveChanges(); return(RedirectToAction("SearchNotes", "SearchNotes")); } else { UserProfile oldupobj = dbobj.UserProfile.Where(x => x.UserID == obj.ID).FirstOrDefault(); Users olduserobj = dbobj.Users.Where(x => x.ID == obj.ID).FirstOrDefault(); olduserobj.FirstName = model.FirstName; olduserobj.LastName = model.LastName; olduserobj.EmailID = model.EmailID; olduserobj.ModifiedDate = DateTime.Now; olduserobj.ModifiedBy = olduserobj.ID; oldupobj.DOB = model.DateOfBirth; oldupobj.Gender = model.Gender; oldupobj.PhoneNumberCountryCode = model.CountryCode; oldupobj.PhoneNumber = model.PhoneNumber; oldupobj.AddressLine1 = model.AddressLine1; oldupobj.AddressLine2 = model.AddressLine2; oldupobj.City = model.City; oldupobj.State = model.State; oldupobj.ZipCode = model.ZipCode; oldupobj.Country = model.CountryID; oldupobj.University = model.University; oldupobj.College = model.College; oldupobj.ModifiedDate = DateTime.Now; oldupobj.ModifiedBy = obj.ID; string path = Path.Combine(Server.MapPath("~/Members"), obj.ID.ToString()); //Saving Profile Picture if (model.ProfilePicture != null && model.ProfilePicture.ContentLength > 0) { var OldProfilePicture = Server.MapPath(oldupobj.ProfilePicture); FileInfo file = new FileInfo(OldProfilePicture); if (file.Exists) { file.Delete(); } var ProfilePicture = DateTime.Now.ToString().Replace(':', '-').Replace(' ', '_') + Path.GetExtension(model.ProfilePicture.FileName); var ImageSavePath = Path.Combine(Server.MapPath("~/Members/" + obj.ID + "/") + "DP_" + ProfilePicture); model.ProfilePicture.SaveAs(ImageSavePath); oldupobj.ProfilePicture = Path.Combine(("Members/" + obj.ID + "/"), "DP_" + ProfilePicture); dbobj.SaveChanges(); } dbobj.Entry(olduserobj).State = System.Data.Entity.EntityState.Modified; dbobj.Entry(oldupobj).State = System.Data.Entity.EntityState.Modified; dbobj.SaveChanges(); return(RedirectToAction("SearchNotes", "SearchNotes")); } } ViewBag.ProfilePicture = dbobj.UserProfile.Where(x => x.UserID == obj.ID).Select(x => x.ProfilePicture).FirstOrDefault(); return(View(model)); }
/// <summary> /// Creates a new db context using specified user name, cached store front and cached user profile to pre-load cache /// </summary> /// <param name="userName"></param> /// <param name="cachedStoreFront"></param> /// <param name="cachedUserProfile"></param> /// <returns></returns> public IGstoreDb NewContext(string userName, Models.StoreFront cachedStoreFront, Models.StoreFrontConfiguration cachedStoreFrontConfig, Models.UserProfile cachedUserProfile) { return(new GStoreEFDbContext(userName, cachedStoreFront, cachedStoreFrontConfig, cachedUserProfile)); }
public async Task UpdateUserProfileAsync(string id, Models.UserProfile userProfile) { await _container.UpsertItemAsync <Models.UserProfile>(userProfile, new PartitionKey(id)); }
public async Task AddUserProfileAsync(Models.UserProfile userProfile) { await _container.CreateItemAsync <Models.UserProfile>(userProfile, new PartitionKey(userProfile.Id)); }