public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Gig gig = (Gig)domainObject;

            if (gig.Name == string.Empty)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.GIG_NEEDS_A_NAME);
            }
            else if (gig.Name.Length > 100)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.GIG_NAME_IS_TOO_LONG);
            }

            if (gig.Description.Length > 6000)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.GIG_DESCRIPTION_IS_TOO_LONG);
            }

            if (gig.Venue== null)
            {
                validationStateDictionary.AddValidationError("Venue", ValidationStateKeys.GIG_NEEDS_A_VENUE);
            }

            if (gig.Acts == null || (gig.Acts!=null && gig.Acts.Count==0))
            {
                validationStateDictionary.AddValidationError("Acts", ValidationStateKeys.GIG_NEEDS_AT_LEAST_ONE_ACT);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Track track = (Track)domainObject;

            if (track.Style == null)
            {
                validationStateDictionary.AddValidationError("Style", ValidationStateKeys.TRACK_NEEDS_A_STYLE);
            }

            if (track.Artist == null)
            {
                validationStateDictionary.AddValidationError("Artist", ValidationStateKeys.TRACK_NEEDS_AN_ARTIST);
            }

            if (track.Name.Trim() == string.Empty)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.TRACK_NEEDS_A_NAME);
            }

            if (track.Data == null)
            {
                validationStateDictionary.AddValidationError("Data", ValidationStateKeys.TRACK_NEEDS_AN_MP3);
            }
            else if( !ListenTo.Shared.Helpers.TrackHelpers.TrackContainsMP3Data(track))
            {
                validationStateDictionary.AddValidationError("Data", ValidationStateKeys.TRACK_NEEDS_A_VALID_MP3);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Image image = (Image)domainObject;

            if (image.Data == null || image.Data.Length==0)
            {
                validationStateDictionary.AddValidationError("Data", ValidationStateKeys.FILE_NEEDS_DATA);
            }
            else if(!ListenTo.Shared.Helpers.ImageHelpers.IsFileImage(image.Data))
            {
                validationStateDictionary.AddValidationError("Data", ValidationStateKeys.FILE_IS_NOT_AN_IMAGE);
            }
            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Venue venueDO = (Venue)domainObject;

            if (venueDO.Name == string.Empty)
            {
                validationStateDictionary.AddValidationError(ValidationStateKeys.VENUE_NEEDS_NAME);
            }

            if (venueDO.Name.Length > 50)
            {
                validationStateDictionary.AddValidationError(ValidationStateKeys.VENUE_NAME_IS_TOO_LONG);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Comment commentDO = (Comment)domainObject;

            if (commentDO.Body == string.Empty)
            {
                validationStateDictionary.AddValidationError(ValidationStateKeys.COMMENT_BODY_INVALID);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            UserProfile userProfileDO = (UserProfile)domainObject;

            if (userProfileDO.Forename != null && userProfileDO.Forename.Length > 50)
            {
                validationStateDictionary.AddValidationError("Forename", ValidationStateKeys.USERPROFILE_FORENAME_IS_TOO_LONG);
            }

            if (userProfileDO.Surname!=null && userProfileDO.Surname.Length > 50)
            {
                validationStateDictionary.AddValidationError("Surname", ValidationStateKeys.USERPROFILE_SURNAME_IS_TOO_LONG);
            }

            if (userProfileDO.Profile!=null && userProfileDO.Profile.Length > 1000)
            {
                validationStateDictionary.AddValidationError("Profile", ValidationStateKeys.USERPROFILE_PROFILE_IS_TOO_LONG);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            Artist artist = (Artist)domainObject;

            if (artist.Town == null)
            {
                validationStateDictionary.AddValidationError("Town", ValidationStateKeys.ARTIST_NEEDS_A_TOWN);
            }

            if (artist.Style == null)
            {
                validationStateDictionary.AddValidationError("Style", ValidationStateKeys.ARTIST_NEEDS_A_STYLE);
            }

            if (artist.ProfileAddress == string.Empty)
            {
                validationStateDictionary.AddValidationError("ProfileAddress", ValidationStateKeys.ARTIST_NEEDS_A_PROFILE_ADDRESS);
            }
            else
            {
                if (!FormatHelpers.IsAlphaNumeric(artist.ProfileAddress))
                {
                    validationStateDictionary.AddValidationError("ProfileAddress", ValidationStateKeys.ARTIST_PROFILE_ADDRESS_MUST_BE_ALPHA_NUMERIC);
                }

                Artist artistWithProfileAddress = ArtistManager.GetByProfileAddress(artist.ProfileAddress);
                if (artistWithProfileAddress != null && artistWithProfileAddress.ID != artist.ID)
                {
                    validationStateDictionary.AddValidationError("ProfileAddress", ValidationStateKeys.ARTIST_PROFILE_ADDRESS_MUST_BE_UNIQUE);
                }
            }

            if (artist.Name == string.Empty)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.ARTIST_NEEDS_A_NAME);
            }

            if (artist.Email != string.Empty && !FormatHelpers.IsEmail(artist.Email))
            {
                validationStateDictionary.AddValidationError("Email", ValidationStateKeys.ARTIST_EMAIL_ADDRESS_INVALID);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary validationStateDictionary = new ValidationStateDictionary();

            NewsItem newsItem = (NewsItem)domainObject;

            if (newsItem.Name.Trim() == string.Empty)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.NEWSITEM_NEEDS_A_NAME);
            }
            else if(newsItem.Name.Length> 50)
            {
                validationStateDictionary.AddValidationError("Name", ValidationStateKeys.NEWSITEM_NAME_IS_TOO_LONG);
            }

            if (newsItem.Description.Trim() == string.Empty)
            {
                validationStateDictionary.AddValidationError("Description", ValidationStateKeys.NEWSITEM_NEEDS_A_DESCRIPTION);
            }
            else if (newsItem.Description.Length > 200)
            {
                validationStateDictionary.AddValidationError("Description", ValidationStateKeys.NEWSITEM_DESCRIPTION_IS_TOO_LONG);
            }

            if (newsItem.Body.Trim() == string.Empty)
            {
                validationStateDictionary.AddValidationError("Body", ValidationStateKeys.NEWSITEM_NEEDS_A_BODY);
            }
            //else if (newsItem.Body.Length > 6000)
            //{
            //    validationStateDictionary.AddValidationError("Body", ValidationStateKeys.NEWSITEM_BODY_IS_TOO_LONG);
            //}

            if (newsItem.TargetSites == null || newsItem.TargetSites.Count == 0) {
                validationStateDictionary.AddValidationError("TargetSites", ValidationStateKeys.NEWSITEM_SHOULD_BE_PUBLISHED_TO_AT_LEAST_ONE_SITE);
            }

            return validationStateDictionary;
        }
        public ValidationStateDictionary Validate(ListenTo.Shared.DO.BaseDO domainObject, ListenTo.Shared.DO.UserCredentials userCredentials)
        {
            ValidationStateDictionary  validationStateDictionary =  new ValidationStateDictionary();

            User userDO = (User)domainObject;

            if (userDO.Username == string.Empty || userDO.Username == null)
            {
                validationStateDictionary.AddValidationError("Username", ValidationStateKeys.USER_NEEDS_A_USERNAME);
            }
            else if (userDO.Username.Length < 3 )
            {
                validationStateDictionary.AddValidationError("Username", ValidationStateKeys.USER_USERNAME_TOO_SHORT);

            }
            else if (!FormatHelpers.IsAlphaNumeric(userDO.Username))
            {
                validationStateDictionary.AddValidationError("Username", ValidationStateKeys.USER_USERNAME_MUST_BE_ALPHA_NUMERIC);
            }

            else
            {
                User persistedUser = UserManager.GetUserByUsername(userDO.Username);

                if (persistedUser != null && persistedUser.ID != userDO.ID)
                {
                    validationStateDictionary.AddValidationError("Username", ValidationStateKeys.USER_USERNAME_NOT_AVAILABLE);
                }
            }

            if (userDO.Password == string.Empty || userDO.Password == null)
            {
                validationStateDictionary.AddValidationError("Password", ValidationStateKeys.USER_NEEDS_A_PASSWORD);
            }
            else if(userDO.Password.Length<6)
            {
                validationStateDictionary.AddValidationError("Password", ValidationStateKeys.USER_PASSWORD_TOO_SHORT);
            }

            if (userDO.EmailAddress == string.Empty || userDO.EmailAddress == null)
            {
                validationStateDictionary.AddValidationError("EmailAddress", ValidationStateKeys.USER_NEEDS_A_EMAILADDRESS);
            }
            else
            {
                if (!Helpers.FormatHelpers.IsEmail(userDO.EmailAddress))
                {
                    validationStateDictionary.AddValidationError("EmailAddress", ValidationStateKeys.USER_NEEDS_A_VALID_EMAILADDRESS);
                }
                else
                {
                    User persistedUser = UserManager.GetUserByEmailAddress(userDO.EmailAddress);

                    if (persistedUser!=null) {
                        validationStateDictionary.AddValidationError("EmailAddress", ValidationStateKeys.USER_NEEDS_A_UNIQUE_EMAILADDRESS);
                    }
                }

            }

            return validationStateDictionary;
        }