public FilamentViewModel(FilamentCalcContext context) { this._context = context; this.Filament = new Filament(); this.Filamenttypes = context.FilamentTypes.ToList(); this.Manufacturers = context.Manufacturers.ToList(); }
public FilamentViewModel(int?id, FilamentCalcContext context) { this._context = context; this.Filament = context.Filaments.FirstOrDefault(c => c.FilamentId == id); this.Filamenttypes = context.FilamentTypes.ToList(); this.Manufacturers = context.Manufacturers.ToList(); }