Skip to content
stack72 edited this page Oct 15, 2010 · 10 revisions

Dynamic Find methods

The dynamic Table properties exposed by the Database object will accept a variety of methods starting with Find. Methods starting with FindBy return a single dynamic object; methods starting with FindAllBy return an IEnumerable<dynamic>.

FindBy

Simple.Data:

db.Users.FindByNameAndPassword(name, password)

SQL:

SELECT * FROM Users WHERE Name = @Name and Password = @Password

FindAllBy

Simple.Data:

db.Users.FindAllByName(name)

SQL:

 SELECT * FROM User Where Name = @Name
Clone this wiki locally