public bool CheckIsCatagoryInUse(Catagory catagory)
        {
            IArtistDao dao = DALFactory.CreateArtistDao(database);

            if (dao.findByProperty(typeof(Artist).GetProperty("Catagory"), catagory).Count() > 0)
            {
                return(true);
            }
            return(false);
        }
 public Task <bool> CheckEmailIsAvailable(string email, Artist artist)
 {
     return(Task <bool> .Run(() =>
     {
         IArtistDao dao = DALFactory.CreateArtistDao(database);
         IList <Artist> artists = dao.findByProperty(typeof(Artist).GetProperty("Email"), email);
         if (artists != null && artists.Count > 0)
         {
             if (artists.Count == 1 && artists.First().Id == artist.Id)
             {
                 return true;
             }
             return false;
         }
         return true;
     }));
 }