c# - Saving document to second RavenDb from MVC webpage -
i've got project i've inherited , i've started working ravendb. i'm needing save document 1 database has connection with, need save document second ravendb. wondering how go that? below method need alter.
[httppost] public actionresult savecontact(contactinput input) { var id = getid(); var profile = ravensession.load<techprofile>(id) ?? new techprofile(); input.mappropertiestoinstance(profile); // check existing user if (ravensession.query<techprofile>().any(x => x.email == profile.email && x.id != profile.id)) { return json(new {error = "profile exists email address.", msg = "error"}); } ravensession.store(profile); return json(new {error = "", msg = "success", id = profile.id.substring(profile.id.lastindexof("/") + 1)}); }
you need create second session , point toward second database. entities aren't tied particular session in ravendb, can that.
Comments
Post a Comment