Ejemplo n.º 1
0
        private Designer EntityToDesigner(DesignerEntity toConvert)
        {
            if (toConvert == null)
            {
                throw new ArgumentNullException();
            }
            Designer conversion;

            try
            {
                conversion = new Designer(toConvert.Name, toConvert.Surname, toConvert.UserName,
                                          toConvert.Password, toConvert.RegistrationDate, toConvert.LastLoginDate);
            }
            catch (ArgumentNullException) {
                throw new InconsistentDataException();
            }
            return(conversion);
        }
Ejemplo n.º 2
0
        private DesignerEntity DesignerToEntity(Designer toConvert)
        {
            if (toConvert == null)
            {
                throw new ArgumentNullException();
            }

            DesignerEntity conversion = new DesignerEntity()
            {
                Name             = toConvert.Name,
                Surname          = toConvert.Surname,
                UserName         = toConvert.UserName,
                Password         = toConvert.Password,
                RegistrationDate = toConvert.RegistrationDate,
                LastLoginDate    = toConvert.LastLoginDate,
            };

            return(conversion);
        }