Пример #1
0
 public void SaveProject(SequenceProject project, ObjectId creatorId)
 {
     if (project._id == ObjectId.Empty)
     {
         db.AddItem(project, creatorId);
     }
     else
     {
         db.UpdateItem(project);
     }
 }
Пример #2
0
 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);
     }
 }