view SilverlightValidation/SilverlightValidation.PL/Models/UserModel.cs @ 114:e51a6af1c98d

working version
author adminsh@apollo
date Sat, 19 May 2012 16:53:34 +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();
        }
    }
}