Пример #1
0
 public static List <Translit> GetTranslitsByUserGuid(Guid userGuid)
 {
     using (var context = new TransliterationDBContext())
     {
         return(context.Translits.Where(x => x.UserGuid == userGuid).ToList());
     }
 }
Пример #2
0
 public static bool UserExists(string login)
 {
     using (var context = new TransliterationDBContext())
     {
         return(context.Users.Any(u => u.Login == login));
     }
 }
Пример #3
0
 public static User GetUserByLogin(string login)
 {
     using (var context = new TransliterationDBContext())
     {
         return(context.Users.FirstOrDefault(u => u.Login == login));
     }
 }
Пример #4
0
 public static void AddUser(User user)
 {
     using (var context = new TransliterationDBContext())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }
Пример #5
0
 public static void AddTranslit(Translit translit)
 {
     using (var context = new TransliterationDBContext())
     {
         translit.DeleteDatabaseValues();
         context.Translits.Add(translit);
         context.SaveChanges();
     }
 }