Created
May 26, 2014 11:29
-
-
Save Pierry/b5eea368e9452e69279a to your computer and use it in GitHub Desktop.
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
public DomainContext() : base(""){ | |
Configuration.LazyLoadingEnable = false; | |
Configuration.ProxyCreationEnable = false; | |
} |
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
public static void Register(HttpConfiguration config){ | |
// Web API configuration and services | |
var formatters = GlobalConfiguration.Configuration.Formatters; | |
var jsonFormatter = formatters.JsonFormatter; | |
jsonFormatter.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None; | |
config.Formatters.Remove(config.Formatters.XmlFormatter); | |
cofnfig.Formatters.JsonF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment