public FuelRecordsListViewModel(IFuelRecordRepository fuelRecordRepository) { if (fuelRecordRepository == null) { throw new ArgumentNullException("repository must not be null"); } this._fuelRecordRepository = fuelRecordRepository; }
public FuelRecordDetailsViewModel(IFuelRecordRepository repository, int id) : this(repository) { if (id <= 0) { throw new ArgumentException("id must be greater than 0!"); } this.Load(id); }
public FuelRecordDetailsViewModel(IFuelRecordRepository repository) { if (repository == null) { throw new ArgumentNullException("repository must not be null"); } this._repository = repository; this.FuelRecord = new FuelRecord(); }
/// <summary> /// Contructor /// </summary> /// <param name="repository">repository</param> /// <param name="id">id of editing entity.Use id different from 0 to edit object. Use 0 to create new object</param> public FuelRecordCreateOrEditViewModel(IFuelRecordRepository repository, int id) : this(repository) { if (id < 0) { throw new ArgumentException("id must be greater than 0!"); } if (id == 0) { this.CreateNew(); } else { this.Load(id); } }