public void Put(ProfileQuery profileQuery) { try { _dataService.SaveProfileQuery(profileQuery); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
// POST api/profilequeries public ProfileQuery Post(ProfileQuery profileQuery) { try { if (profileQuery.Id == null || profileQuery.Id == "null") profileQuery.Id = null; _dataService.SaveProfileQuery(profileQuery); return profileQuery; } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } }
public void SaveProfileQuery(ProfileQuery profileQuery) { var documentStore = GetDocumentStore(); var session = documentStore.OpenSession(); //if (String.IsNullOrEmpty(profileQuery.Id)) //{ // var existing = session.Load<ProfileQuery>(profileQuery.Id); //} //else //{ session.Store(profileQuery); session.SaveChanges(); //} }