Exemple #1
0
        private void FixupUser(User previousValue)
        {
            if (previousValue != null && previousValue.Articles.Contains(this))
            {
                previousValue.Articles.Remove(this);
            }

            if (User != null)
            {
                if (!User.Articles.Contains(this))
                {
                    User.Articles.Add(this);
                }
                if (User_Id != User.Id)
                {
                    User_Id = User.Id;
                }
            }
            else if (!_settingFK)
            {
                User_Id = null;
            }
        }
        public static User GetEntity(this UserPrimitive primitive)
        {
            User result = new User();

                result.Id = primitive.Id;

                result.Nick = primitive.Nick;

                result.Name = primitive.Name;

                result.Surname = primitive.Surname;

                result.Email = primitive.Email;

                result.Password = primitive.Password;

                result.PasswordSalz = primitive.PasswordSalz;

                result.Phone = primitive.Phone;

                result.CreateTime = primitive.CreateTime;

                result.DeleteTime = primitive.DeleteTime;

                return result;
        }