public ServisController(BL.ModelView.ServisView view) { try { entities = new DB.DETLT2020Entities(); Service = entities.Services.Where(x => x.Title == view.Title).First();; } catch { throw new Exception("Ошибка БД"); } }
public AddEndCangeServis(BL.ModelView.ServisView view) { InitializeComponent(); try { var cn = new BL.ServisController(view); service = cn.Service; mainGrid.DataContext = service; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }