using ProjectGrid.Data; using System; using System.Collections.Generic; namespace ProjectGrid.Models { public class UserRepository : IUserRepository { private List users = new List(); private int _nextId = 1; public UserRepository() { Add(new UserModel { firstName = "first1", lastName = "last1", email = "email1@gmail.com" }); Add(new UserModel { firstName = "first2", lastName = "last2", email = "email2@gmail.com" }); Add(new UserModel { firstName = "first3", lastName = "last3", email = "email3@gmail.com" }); } public IEnumerable GetAll() { return users; } public UserModel Add(UserModel item) { if (item == null) { throw new ArgumentNullException("item"); } item.Id = _nextId++; users.Add(item); return item; } } }