コード例 #1
0
 public void DeletePartner(GreekPartnerModel partner)
 {
     using (IDocumentSession session = DataDocumentStore.Store.OpenSession())
     {
         var delPartner = session.Load <GreekPartnerModel>(partner.Id);
         session.Delete(delPartner);
         session.SaveChanges();
     }
 }
コード例 #2
0
        public GreekPartnerModel CreatePartner(GreekPartnerModel partner)
        {
            using (IDocumentSession session = DataDocumentStore.Store.OpenSession())
            {
                session.Store(partner);
                session.SaveChanges();
            }

            return(partner);
        }
コード例 #3
0
        public GreekPartnerModel UpdatePartner(GreekPartnerModel partner)
        {
            //var modelData = JsonConvert.SerializeObject(partner);

            using (IDocumentSession session = DataDocumentStore.Store.OpenSession())
            {
                session.Store(partner);
                session.SaveChanges();
            }

            return(partner);
        }
コード例 #4
0
        public ActionResult DeletePartner([DataSourceRequest] DataSourceRequest request, GreekPartnerModel partner)
        {
            if (partner != null)
            {
                _greekPartnerRepository.DeletePartner(partner);
            }

            return(Json(new[] { partner }.ToDataSourceResult(request, ModelState)));
        }