Exemplo n.º 1
0
        Word AddWord(VocabularyDbContext context, string word, LanguageType language)
        {
            Word entity = context.Words.SingleOrDefault(w => w.Value == word && w.Language == (int)language);

            if (entity == null)
            {
                entity = new Word {
                    Value = word, Language = (int)language
                };
                context.Words.Add(entity);
            }
            return(entity);
        }
Exemplo n.º 2
0
 public AccountController(VocabularyDbContext db)
     : this(new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(db)))
 {
     this.db = db;
     repo    = new Repository(db);
 }
Exemplo n.º 3
0
 public UserBookController() {
     db = new VocabularyDbContext();
     repo = new Repository(db);
 }
Exemplo n.º 4
0
 public HomeController()
 {
     db   = new VocabularyDbContext();
     repo = new Repository(db);
 }
Exemplo n.º 5
0
 public UserBookController()
 {
     db   = new VocabularyDbContext();
     repo = new Repository(db);
 }
Exemplo n.º 6
0
 public HomeController() {
     db = new VocabularyDbContext();
     repo = new Repository(db);
 }
Exemplo n.º 7
0
 public AccountController(VocabularyDbContext db)
     : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(db))) {
     this.db = db;
     repo = new Repository(db);
 }
Exemplo n.º 8
0
 public Repository(VocabularyDbContext db) {
     this._db = db;
 }