Editing DbContext Template
Posted: Wed 01 Oct 2014 14:47
Good Day,
I'm getting a syntax error in the DbContext error when I do the following:
1) Delete old DbContext template from the model.
2) Add a new DbContext from the built-in templates.
3) Double click on the template to edit it.
At this point, without making any changes to the template, the follow errors appear:
The code in that area is:
Thanks,
Patrick Connelly
I'm getting a syntax error in the DbContext error when I do the following:
1) Delete old DbContext template from the model.
2) Add a new DbContext from the built-in templates.
3) Double click on the template to edit it.
At this point, without making any changes to the template, the follow errors appear:
Code: Select all
Error 30 Semicolon expected DbContext 3171 153
Error 31 Syntax error DbContext 3171 153
Code: Select all
3167 XmlReader mappingReader = XmlReader.Create(edmx.Msl.Stream, settings);
3168 ConstructorInfo storageMappingItemCollectionConstructor = ef6Assembly.GetType("System.Data.Entity.Core.Mapping.StorageMappingItemCollection")
3169 .GetConstructor(new Type[] { conceptualItems.GetType(), storeItems.GetType(), typeof(IEnumerable<XmlReader>) });
3170 object mappingItems = storageMappingItemCollectionConstructor.Invoke(new object[] { conceptualItems, storeItems, new XmlReader[] { mappingReader }.AsEnumerable() });
3171
3172 object errors = Activator.CreateInstance(typeof(List<>).MakeGenericType(ef6Assembly.GetType("System.Data.Entity.Core.Metadata.Edm.EdmSchemaError")));
3173
3174 MethodInfo generateViewsMethod = mappingItems
3175 .GetType()
3176 .GetMethods(BindingFlags.Instance | BindingFlags.Public)
3177 .First(mi => mi.Name == "GenerateViews" && mi.GetParameters().Length == 1);
Patrick Connelly