public bool Add(Person Person) { if(_db.People.Count(x => x.Name.Equals(Person.Name) && x.BirthDay == Person.BirthDay) > 0) { Errors.Add("Item já cadastrado."); return false; } PrepareNewPerson(Person); _db.People.Add(Person); return _db.Commit(); }
private void PrepareNewPerson(Person Person) { Person.Id = (GetLastId() + 1); Person.Status = true; }