public void Configuration(IAppBuilder app) { // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888 using (AdvertisementDatabase adDB = new AdvertisementDatabase()) { AdvertisementSearch.AddUpdateLuceneIndex(adDB.Advertisements.ToList()); UserSearch.AddUpdateLuceneIndex(adDB.Users.ToList()); UserProfileSearch.AddUpdateLuceneIndex(adDB.UserProfiles.ToList()); } }
//[ValidateAntiForgeryToken] public void Edit(EditProfileViewModel model) { if (!Security.IsAuthenticated || !ModelState.IsValid) { ResponseData.WriteFalse(Response); return; } var result = new List <UserProfile> { Profiles.Update(model) }; UserProfileSearch.AddUpdateLuceneIndex(result); ResponseData.WriteTrue(Response); }
public void Index() { if (!Security.IsAuthenticated) { return; } var profile = UserProfileSearch.GetByIndexRecords(CurrentUser.UserProfileId.ToString()).ToArray()[0]; dynamic rez = new ExpandoObject(); rez.Id = profile.Id; rez.Bio = profile.Bio; rez.Email = profile.Email; rez.Name = profile.Name; rez.Phone = profile.Phone; var result = new List <dynamic> { rez }; ResponseData.WriteList(Response, "result", result); }