Пример #1
0
        /// <summary>
        /// Save Northwind metadata to a script file
        /// Certain tests will load this script dynamically so they can get metadata
        /// without making a Web API call
        /// </summary>
        public static void WriteNorthwindMetadataScriptFile()
        {
            var metadata = new NorthwindRepository().Metadata;
            var scriptFilename = HostingEnvironment.MapPath("~/tests/helpers/northwindMetadata.js");
            const string prefix = "docCode.northwindMetadata = ";
            const string postfix = ";";

            using (var writer = new StreamWriter(scriptFilename))
            {
                writer.WriteLine(prefix + metadata + postfix);
            }
        }
Пример #2
0
 public NorthwindController()
 {
     // Todo: inject via an interface rather than "new" the concrete class
     _repository = new NorthwindRepository();
 }
 // Todo: inject via an interface rather than "new" the concrete class
 public NorthwindController(NorthwindRepository repository)
 {         
     _repository = repository ?? new NorthwindRepository();
 }
Пример #4
0
 // Todo: inject via an interface rather than "new" the concrete class
 protected MultiBaseController(NorthwindRepository repository)
 {         
     Repository = repository ?? new NorthwindRepository();
 }