Skip to content

igolets/TaskDemo

Repository files navigation

TaskDemo

The goal of this project is to demonstrate some complex ideas and technologies on a simple task. You can use it when nearning C#/ASP.NET MVC or when teaching others. Feel free to contact me if you have any questions/suggestions

Requirements

  • Create a new application to manage tasks using ASP.NET MVC 5 with Bootstrap.
  • Create a very simple list view to show Tasks with Add, Delete actions
  • Tasks can have subtasks and so on.. (unlimited nesting)
  • Task name must be unique on a given nesting level.
  • Do server and client Validations.
  • Save the form to the database.
  • Support only modern browsers
  • Use : ( Sql Server Express / Local db, EF, NUnit or other test framework)

How to run

  • Clone the repo
  • Open solution in Visual Studio and build (I've used VS2017, but no new C# features used, it should work on earlier versions of Visual Studio)
  • Restore NUGET packages
  • Create new empty DB on MSSQL server and update web.config file in TaskDemo.Web project (I've used Localdb, but more mature versions should work as well).
  • Run TaskDemo.Web project, it will create DB itself

What you can find in the code

What else you may find after a deeper look

  • Project is ready for but not used (for such simple case) EF migrations
  • Unity is configured in code in order to have compile-time consistency checks, but you can see in comments how to move settings to web.config.
  • I'm using generic repositories, but code is ready to define custom repos and add some logic to them
  • Elmah does not send data to SQL oo email, but this is very easy to set up
  • No authentication there, but it is possible to add this and unit test authentication logic. This is a bit more compex task, so it is out of the scope
  • WebAPI controllers require some specific efforts to use Dependency Injection. All code is there, if you add WebAPI it should work and you'll be able to unit test thise controllers too

Author

Ilya Golets ([email protected])

License

MIT