public void ViewMapping_AreEqualTest() { var model1 = new ViewMapping <TestViewModel1, TestPage1>(); var model2 = new ViewMapping <TestViewModel1, TestPage1>(); Assert.Equal(model1, model2); }
private void RefreshViews(Project project, Connection connection, ref List <string> errors) { DataTable dataTable = GetViews(project, connection); var duplicates = FindDuplicates(dataTable, QueryConstants.TableOrView.SchemaName, QueryConstants.TableOrView.Name); if (duplicates.Any()) { errors.Add(FormatDuplicates(duplicates)); return; } //Add tables to the project foreach (DataRow dr in dataTable.Rows) { string schemaName; string name; ViewMapping vm; ExtractTableInfo(dr, out schemaName, out name); vm = project.FindViewMapping(connection.Name, schemaName, name); if (vm == null) { vm = new ViewMapping(connection.Name, schemaName, name, name, null, null, null, null); vm.JoinToProject(project); project.ViewMappings.Add(vm); } else if (!string.Equals(vm.SchemaName, schemaName)) { vm.SchemaName = schemaName; } } RemoveNonExistantViews(project, connection, dataTable); }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public ViewColumnMapping( IProperty property, ViewColumn column, ViewMapping viewMapping) : base(property, column, viewMapping) { }
public void ViewModelViewMappings_DuplicatesExceptionTest() { var mapper = new ViewModelViewMappings(new TestInitiliser()); Assert.Equal(0, mapper.Count); var model1 = new ViewMapping <TestViewModel1, TestPage1>(); var model2 = new ViewMapping <TestViewModel1, TestPage2>(); mapper.AddMapping(model1); Assert.True(mapper.ContainsKey <TestViewModel1>()); Assert.Same(mapper.GetViewType <TestViewModel1>(), typeof(TestPage1)); Assert.Throws <InvalidOperationException>(() => { mapper.AddMapping(model2); }); }
protected virtual ViewMapping UpdateDataContextInternal(RegionMapping target, GameObject view, ViewMapping viewMapping, object dataContext) { viewMapping.OnDataContextChange(target, view, viewMapping.DataContext, dataContext); viewMapping.DataContext = dataContext; return(viewMapping); }
protected virtual ViewMapping UnlockViewInternal(RegionMapping target, GameObject view, ViewMapping viewMapping) { view.SetActive(false); // TODO find a way to lock view and not to hide viewMapping.OnViewUnlocked(target, view); return(viewMapping); }
protected virtual ViewMapping ShowViewInternal(RegionMapping target, GameObject view, ViewMapping viewMapping) { view.SetActive(true); viewMapping.OnViewShown(target, view); ExecuteShowViewUpdateCommands(); return(viewMapping); }
protected virtual ViewMapping HideViewInternal(RegionMapping target, GameObject view, ViewMapping viewMapping) { view.SetActive(false); viewMapping.OnViewHidden(target, view); ExecuteHideViewUpdateCommands(); return(viewMapping); }
protected virtual ViewMapping UnmapViewInternal(RegionMapping target, GameObject view, ViewMapping viewMapping) { view.SetActive(false); Destroy(view); viewMapping.OnViewUnmapped(target, view); ExecuteUnmapViewUpdateCommands(); return(viewMapping); }