示例#1
0
        public static UserVIewModel FromDB(UserData context)
        {
            var user = new UserVIewModel();

            user.Id         = context.Id;
            user.Name       = context.Name;
            user.MIddleName = context.MiddleName;
            user.LastName   = context.LastName;

            return(user);
        }
示例#2
0
        public void FillUsers()
        {
            Users = new ObservableCollection <UserVIewModel>();

            using (var context = new EntityContext())
            {
                foreach (UserData user in context.UserData)
                {
                    if (user.IsDeleted == false)
                    {
                        Users.Add(UserVIewModel.FromDB(user));
                    }
                }
            }
        }