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); }