view SilverlightValidation/SilverlightValidation.PL/Models/UserModel.cs @ 121:8f94475d3146 tip

final code
author stevenh7776
date Thu, 31 May 2012 15:35:26 +0100
parents 11994ccdc50b
children
line wrap: on
line source

using System;
using SilverlightValidation.Interfaces;

namespace SilverlightValidation.Models
{
    public class UserModel : IUserModel
    {
        public string Username { get; set; }
        public string Password { get; set; }
        public string Email { get; set; }
        public DateTime? DateOfBirth { get; set; }
        public string Description { get; set; }

        private UserModel() { }

        public static UserModel Create(string username = "",
                                        string password = "",
                                        string email = "",
                                        DateTime? dateOfBirth = null,
                                        string descripton = "")
        {
            return new UserModel()
                       {
                           Username = username,
                           Password = password,
                           Email = email,
                           DateOfBirth = dateOfBirth,
                           Description = descripton
                       };
        }

        public IUserModel Clone()
        {
            return (UserModel)this.MemberwiseClone();
        }
    }
}