private List<PlatformUser> GetUsersFromDB() { using (var cxt = new MTS_LIVEEntities()) { try { return cxt.PLATFORM_USER.Select(x => new PlatformUser { ID = x.ID, Title = x.Title, Name = x.Name, Surname = x.Surname, Patronym = x.Patronym, Description = x.Description, Login = x.Login, RoleMask = (UserRole)x.RoleMask } ).ToList(); } catch (Exception ex) { Console.WriteLine(ex); //Logger.Error("Ошибка получения списка пользователей из БД", ex); return new List<PlatformUser>(); } } }
private List <PlatformUser> GetUsersFromDB() { using (var cxt = new MTS_LIVEEntities()) { try { return(cxt.PLATFORM_USER.Select(x => new PlatformUser { ID = x.ID, Title = x.Title, Name = x.Name, Surname = x.Surname, Patronym = x.Patronym, Description = x.Description, Login = x.Login, RoleMask = (UserRole)x.RoleMask } ).ToList()); } catch (Exception ex) { Console.WriteLine(ex); //Logger.Error("Ошибка получения списка пользователей из БД", ex); return(new List <PlatformUser>()); } } }