Fake Rest Repository with already available data to play around.
- Users
- Jeopardy Questions
- Nasa Facilities (Nasa Open Data)
- Nasa Patents (Nasa Open Data)
- Add the new Json file with name conventions : EntityNameJsonData.json
- Make sure the Json sturcture of the entity has an Id field.
- Create a new class in Models folder with the same EntiyName as in the name of json dataset file.
- Derive the new class from BaseClass and implemnt GetSearchableText method. This methods returns a string made of Searchable fields and used by search function.
- Add a new Controller for the Entity and derive it from BaseController
- Provide proper route the access the new controller and that's all. The BaseController has all the Logic to handle requests.
public class User : BaseClass
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Gender { get; set; }
public string Avatar { get; set; }
public override string GetSearchableText()
{
return Id + FirstName + LastName + Email + Gender;
}
}
[RoutePrefix("api/user")]
public class UserController : BaseController<User>
{
}