コード例 #1
0
 public void Put(ProfileQuery profileQuery)
 {
     try
     {
         _dataService.SaveProfileQuery(profileQuery);
     }
     catch
     {
         throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
     }
 }
コード例 #2
0
 // 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));
     }
 }
コード例 #3
0
        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();
            //}
        }