示例#1
0
        private static void CreateJsonModelForFacetModel(XdbModel model)
        {
            try
            {
                var fileName = XdbPurchaseModel.Model.FullName + ".json";
                var json     = XdbModelWriter.Serialize(model);
                System.IO.File.WriteAllText(fileName, json);

                Console.WriteLine($"Json-model file successfully created for {model.GetType()}.{Environment.NewLine}");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception while creating json-model for {model.GetType()}: {ex.Message}{Environment.NewLine}");
                Console.WriteLine($"{Environment.NewLine}{Environment.NewLine}Make sure that the console app is launched WITHIN the bin-folder of the RAI-wwwRoot folder!{Environment.NewLine}");
            }

            Console.WriteLine($"--------------------------------------------------{Environment.NewLine}");
        }
示例#2
0
        private static void Main()
        {
            Console.WriteLine("Generating your model...");

            var model = CollectionModel.Model;

            var serializedModel = XdbModelWriter.Serialize(model);

            var pathToOutput = AppContext.BaseDirectory;

            if (!Directory.Exists(pathToOutput))
            {
                Directory.CreateDirectory(pathToOutput);
            }

            var modelFullName = pathToOutput + "LetsPlay.XConnectModel, 1.0" + ".json";

            File.WriteAllText(modelFullName, serializedModel);
        }
        private static async Task MainAsync(string[] args)
        {
            CertificateWebRequestHandlerModifierOptions options =
                CertificateWebRequestHandlerModifierOptions.Parse("StoreName=My;StoreLocation=LocalMachine;FindType=FindByThumbprint;FindValue=75980C7DD01B535796DEE0A8E682F28EB465536D");

            var certificateModifier = new CertificateWebRequestHandlerModifier(options);

            List <IHttpClientModifier> clientModifiers = new List <IHttpClientModifier>();
            var timeoutClientModifier = new TimeoutHttpClientModifier(new TimeSpan(0, 0, 20));

            clientModifiers.Add(timeoutClientModifier);

            var collectionClient    = new CollectionWebApiClient(new Uri("https://schackwishingwebz01xconnect/odata"), clientModifiers, new[] { certificateModifier });
            var searchClient        = new SearchWebApiClient(new Uri("https://schackwishingwebz01xconnect/odata"), clientModifiers, new[] { certificateModifier });
            var configurationClient = new ConfigurationWebApiClient(new Uri("https://schackwishingwebz01xconnect/configuration"), clientModifiers, new[] { certificateModifier });

            var cfg = new XConnectClientConfiguration(
                new XdbRuntimeModel(ConsentModel.Model), collectionClient, searchClient, configurationClient);

            var json = XdbModelWriter.Serialize(ConsentModel.Model);

            Console.WriteLine(json);
        }
示例#4
0
        static void Main(string[] args)
        {
            var json = XdbModelWriter.Serialize(JonathanRobbins.xTendingxConnect.ProductCatalogue.Models.SampleModel.Model);

            int i = 0;
        }
示例#5
0
        static void Main(string[] args)
        {
            var json = XdbModelWriter.Serialize(SF.Foundation.Facets.Models.CollectionModel.Model);

            System.IO.File.WriteAllText("UserSettings.Model.json", json);
        }
        public static void Serialize()
        {
            var model = XdbModelWriter.Serialize(XConnectPOC.Collection.Model.CollectionModel.MySiteCollectionModel.Model);

            File.WriteAllText(XConnectPOC.Collection.Model.CollectionModel.MySiteCollectionModel.Model.FullName + ".json", model);
        }
示例#7
0
 static void Main(string[] args)
 {
     var fileName = ProductModel.Model.FullName + ".json";
     var model = XdbModelWriter.Serialize(ProductModel.Model);
     System.IO.File.WriteAllText(fileName, model);
 }
        static void Main(string[] args)
        {
            var json = XdbModelWriter.Serialize(SF.Foundation.PushNotifications.Models.CollectionModel.Model);

            System.IO.File.WriteAllText("PushNotifications.Model.json", json);
        }
示例#9
0
 static void Main(string[] args)
 {
     var json = XdbModelWriter.Serialize(ModelBuilder.Model);
 }