public PersonDetailsDesignViewModel() { var person = new Person(); person.FirstName = "Hendrik"; person.LastName = "Lösch"; person.BirthDate = DateTime.Now; for (int i = 0; i < 20; i++) { person.Numbers.Add(new KeyValuePair<int,int>(i,i)); } this.SelectedPerson = person; }
public void Support(ISpecify specification) { var filler = new Filler<Person>(); filler.Setup() .OnProperty(x => x.Error) .IgnoreIt() .OnProperty(x => x.Id) .IgnoreIt() .OnProperty(x => x.Numbers) .IgnoreIt() .OnProperty(x => x.BirthDate) .Use(new DateTimeRange(new DateTime(1851, 1, 1), DateTime.Now)); this.Person = filler.Create(); }
public void Update(Person person) { this.context.Persons.AddOrUpdate(person); this.context.SaveChanges(); }
private void OnPersonSelected(Person person) { if (person.Id != 0) { this.SelectedPerson = this.repository.GetPerson(person.Id); } }