public void DeletePartner(GreekPartnerModel partner) { using (IDocumentSession session = DataDocumentStore.Store.OpenSession()) { var delPartner = session.Load <GreekPartnerModel>(partner.Id); session.Delete(delPartner); session.SaveChanges(); } }
public GreekPartnerModel CreatePartner(GreekPartnerModel partner) { using (IDocumentSession session = DataDocumentStore.Store.OpenSession()) { session.Store(partner); session.SaveChanges(); } return(partner); }
public GreekPartnerModel UpdatePartner(GreekPartnerModel partner) { //var modelData = JsonConvert.SerializeObject(partner); using (IDocumentSession session = DataDocumentStore.Store.OpenSession()) { session.Store(partner); session.SaveChanges(); } return(partner); }
public ActionResult DeletePartner([DataSourceRequest] DataSourceRequest request, GreekPartnerModel partner) { if (partner != null) { _greekPartnerRepository.DeletePartner(partner); } return(Json(new[] { partner }.ToDataSourceResult(request, ModelState))); }