mercredi 15 juillet 2015

How to search for many-to-many in web with only one input textbox?

I am making a BookStore web with .NET MVC, EF Books and authors have many to many relationship.

Author{
    auID int PK,
    auName nvarchar
    artID int FK Article(artID)
}

Book{
    bookID int PK,
    bookName nvarchar,
    artID int FK Article(artID)
}

AuthorBook{
    auID int
    bookID int
}

I want to search for Book by "authors name string". But one book have many author. Ex: enter "Taylor", it's will return all books which writed by "John Taylor" or {"Taylor Paul","Smith John"}, it's mean the book have at least one author with the name contain "taylor". I don't know exactly how to pass multi "name values" to server but keep "friendly" with users. I think ask them to enter several names delimited by a ";" and split later is so easy for the developer but not for users




Aucun commentaire:

Enregistrer un commentaire