-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove UnityFactory from DataObjectEdmModel
- Loading branch information
Showing
6 changed files
with
25 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,38 +92,11 @@ public class DataObjectEdmModel : EdmModel | |
public DataObjectEdmModel(DataObjectEdmMetadata metadata, IDataObjectEdmModelBuilder edmModelBuilder = null) | ||
{ | ||
EdmModelBuilder = edmModelBuilder; | ||
var container = UnityFactory.GetContainer(); | ||
if (container != null) | ||
if (serviceProvider != null) | ||
{ | ||
if (container.IsRegistered<IExportService>("Export")) | ||
{ | ||
ExportService = container.Resolve<IExportService>("Export"); | ||
} | ||
|
||
if (container.IsRegistered<IExportService>()) | ||
{ | ||
ExportService = container.Resolve<IExportService>(); | ||
} | ||
|
||
if (container.IsRegistered<IExportStringedObjectViewService>("ExportStringedObjectView")) | ||
{ | ||
ExportStringedObjectViewService = container.Resolve<IExportStringedObjectViewService>("ExportStringedObjectView"); | ||
} | ||
|
||
if (container.IsRegistered<IExportStringedObjectViewService>()) | ||
{ | ||
ExportStringedObjectViewService = container.Resolve<IExportStringedObjectViewService>(); | ||
} | ||
|
||
if (container.IsRegistered<IODataExportService>("Export")) | ||
{ | ||
ODataExportService = container.Resolve<IODataExportService>("Export"); | ||
} | ||
|
||
if (container.IsRegistered<IODataExportService>()) | ||
{ | ||
ODataExportService = container.Resolve<IODataExportService>(); | ||
} | ||
ExportService = serviceProvider.GetService<IExportService>(); | ||
This comment has been minimized.
Sorry, something went wrong.
Anisimova2020
Contributor
|
||
ExportStringedObjectViewService = serviceProvider.GetService<IExportStringedObjectViewService>(); | ||
ODataExportService = serviceProvider.GetService<IODataExportService>(); | ||
} | ||
|
||
_metadata = metadata ?? throw new ArgumentNullException(nameof(metadata), "Contract assertion not met: metadata != null"); | ||
|
@@ -741,14 +714,14 @@ private string GetEntityTypeNamespace(Type type) | |
{ | ||
var name = type.Namespace; | ||
if (type != typeof(DataObject) && EdmModelBuilder != null && EdmModelBuilder.EntityTypeNamespaceBuilder != null) | ||
name = EdmModelBuilder.EntityTypeNamespaceBuilder(type); | ||
|
||
// There are extra checks on MS libraries that lead to exceptions if name is empty or null. | ||
if (name == string.Empty) | ||
{ | ||
return "____"; | ||
} | ||
|
||
name = EdmModelBuilder.EntityTypeNamespaceBuilder(type); | ||
|
||
// There are extra checks on MS libraries that lead to exceptions if name is empty or null. | ||
if (name == string.Empty) | ||
{ | ||
return "____"; | ||
} | ||
|
||
return name; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Для чего это изменение?