public void SaveProject(SequenceProject project, ObjectId creatorId) { if (project._id == ObjectId.Empty) { db.AddItem(project, creatorId); } else { db.UpdateItem(project); } }
public AccountController(IMongoRepository db = null, IMongoMembershipService _memb = null) { Db = db ?? DependencyResolver.Current.GetService <IMongoRepository>(); MemberShip = _memb ?? DependencyResolver.Current.GetService <IMongoMembershipService>(); if (Db.GetItem <MongoUser>(x => x.Email == "*****@*****.**") == null) { Db.AddItem <MongoUser>(new MongoUser() { Email = "*****@*****.**", FirstName = "TEST_USER", SecondName = "BIOINFORMATIKA", IsApproved = true, Password = "******", UserName = "******" }, ObjectId.Empty); } }