alexbohomol / ContosoUniversity.Mvc5

My good-parts reference playground, based on ContosoUniversity tutorial (Asp.Net 4.6 stack)
0 stars 0 forks source link

Refactor Repository Contract #6

Closed alexbohomol closed 8 years ago

alexbohomol commented 8 years ago

Agreeing the discussion (https://youtu.be/rtXpYpZdOzM) we should refactor the existing repository contract to smth like:

- Add(obj)
- Remove(obj)
- Get(id)
- GetAll()
- Find(predicate)

No 'Update' here (!)

var course = collection.Get(1);
course.Name = "New Name";

bad!

collection.Update(course);
alexbohomol commented 8 years ago

So the first but not least step here should be - get rid of the Update operation in contract