public HelloWorldViewModel() { HelloWorldModel helloWorldModel = new HelloWorldModel(); titleString = helloWorldModel.ImportantInfo; JoueurName = "Joueur"; }
// // GET: /HelloWorld/ public ActionResult Index() { var postedSignedRequest = Request.Form["signed_request"]; var model = new HelloWorldModel(postedSignedRequest); return(View(model)); }
// GET: HelloWorld public ActionResult Index() { var model = new HelloWorldModel(); model.Message = "Hello World!"; return(View("Index", model)); }
public ActionResult RandomNumber() { HelloWorldModel model = new HelloWorldModel(); model.RandNumber = new Random().Next(0, 100); return(View("Random", model)); }
public async Task <HttpResponseMessage> Get() { HelloWorldModel model = new HelloWorldModel(); model.ReturnValue = ConfigurationManager.AppSettings["ReturnValueText"]; return(Request.CreateResponse(HttpStatusCode.OK, model.ReturnValue)); }
public async Task <HelloWorldModel> CreateAsync(HelloWorldModel helloWorld) { var tasks = _repositories.Select(r => r.CreateAsync(helloWorld)); await Task.WhenAll(tasks); return(helloWorld); }
public ActionResult RandomNumber() { var model = new HelloWorldModel(); model.GeneratedNumber = new Random().Next(1, 50); return(View("RandomNumber", model)); }
public IActionResult Index() { var model = new HelloWorldModel(); model.PageContext = "hello World"; return(View(model)); }
public HelloWorldModel GetMessage() { HelloWorldModel model = null; restClient.BaseUrl = new Uri(ConfigurationManager.AppSettings.Get(AppSettings.HelloWorldApiUrl)); restRequest.Resource = "helloworld"; restRequest.Method = Method.GET; restRequest.Parameters.Clear(); try { var helloWorldResponse = restClient.Execute <HelloWorldModel>(restRequest); if (helloWorldResponse != null) { if (helloWorldResponse.Data != null) { model = helloWorldResponse.Data; } } } catch (Exception ex) { //Log the exception } return(model); }
public void HelloWorldSample3() { HelloWorldModel model = new HelloWorldModel { Property = "", Value = 999 }; TestRunner.Test(model); }
public void HelloWorldSample2() { HelloWorldModel model = new HelloWorldModel { Value = 17 }; TestRunner.Test(model); }
public ActionResult Index() { HelloWorldModel model = new HelloWorldModel(); model.Message = this.HelloWorldMessage; model.TeaserImageUrl = this.TeaserImageUrl; return(View(model)); }
public HelloWorldModel Get(int id) { var bll = ObjectFactory.GetInstance <IHelloWorldRepository>(); var item = new HelloWorldModel(); item.Id = id; item.Greeting = bll.Get(id); return(item); }
public static IActionResult Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HelloWorldModel model) { if (string.IsNullOrWhiteSpace(model?.Name)) { return(new BadRequestObjectResult("Please pass a name on the query string or in the request body")); } return(new OkObjectResult($"Hello, {model.Name}")); }
public async Task <HelloWorldModel> CreateAsync(HelloWorldModel helloWorld) { using (var context = new HelloWorldDbContext()) { context.HelloWorlds.Add(Mapper.Map <HelloWorld>(helloWorld)); await context.SaveChangesAsync(); return(helloWorld); } }
public async Task <HelloWorldModel> GetMessage() { HelloWorldModel model = new HelloWorldModel() { Message = "Hello world" }; await MyTaskAsync(); return(model); }
public ActionResult RandomNumber() { Random random = new Random(); int randomNumber = random.Next(); HelloWorldModel model = new HelloWorldModel(); model.RandomNumber = randomNumber; return(View("RandomNumber", model)); }
private void SetHelloWorldPostViewBag(HelloWorldModel helloWorldModel = null) { if (helloWorldModel is null) { SetHelloWorldGetViewBag(); } else { SetGreetingPhrase(ModelState.IsValid ? helloWorldModel.Name : "Незнакомец"); SetDateTime(); } }
public ActionResult HelloWorld() { HelloWorldModel model = new HelloWorldModel { Name = "Zvi Rotsztein", DOB = Convert.ToDateTime("1987 - 01 - 01"), HomeTown = "London", PathToImage = "https://beithorah.co.il/wp-content/uploads/2020/06/%D7%94%D7%A8%D7%91-%D7%A6%D7%91%D7%99-%D7%A8%D7%95%D7%98%D7%A0%D7%A9%D7%98%D7%99%D7%99%D7%9F-1.jpg" }; return(View(model)); }
public void TestOutput() { var model = new HelloWorldModel(); model.Hello = "Hello World"; var ser = new DataContractJsonSerializer(typeof(HelloWorldModel)); var stream = new MemoryStream(); ser.WriteObject(stream, model); stream.Position = 0; var reader = new StreamReader(stream); Console.WriteLine("Json format: " + reader.ReadToEnd()); }
public ActionResult Index() { var result = new HelloWorldModel(); var response = Client.GetAsync(BaseUrl).Result; if (response.IsSuccessStatusCode) { result = response.Content.ReadAsAsync <HelloWorldModel>().Result; } else { result.DisplayText = response.Content.ReadAsAsync <HttpError>().Result.Message; } return(View(result)); }
private DataInputs SetupTestRecord() { _db = new HelloWorldModel(); var newData = new DataInputs { id = 1, DataInputText = "Hello World" }; _db.DataInputs.Add(newData); _db.SaveChanges(); return(newData); }
public string Write() { try { HelloWorldModel model = _repository.GetMessage(); Console.WriteLine(model.HelloText); } catch (Exception) { // TODO: logging // return failure return(string.Empty); } //return success return(_repository.WriteMessage()); }
static async Task <HelloWorldModel> GetModelAsync(string path) { client.BaseAddress = new Uri("http://localhost:49739/"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); HelloWorldModel model = null; HttpResponseMessage response = await client.GetAsync(path); if (response.IsSuccessStatusCode) { string json = await response.Content.ReadAsStringAsync(); model = JsonConvert.DeserializeObject <HelloWorldModel>(json); } return(model); }
void Start() { VRSettings.renderScale = 1.5f; IElementsFactory elementsFactory = this.GetComponent <ElementsFactory>(); HelloWorldModel vm = new HelloWorldModel(); IPage page173 = new Page(this.MainPage); IStackLayout stackLayout614 = new StackLayout(this.MainPage); ILabel label900 = elementsFactory.CreateLabel("Tap the button"); stackLayout614.AddElement(label900); ILabel label151 = elementsFactory.CreateLabel("{{ message }}"); vm.message.Subscribe((x) => { label151.Text = vm.message.Value; }); stackLayout614.AddElement(label151); IButton button342 = elementsFactory.CreateButton("TAP"); button342.AddOnClick(vm.onTap); stackLayout614.AddElement(button342); }
public async Task <HelloWorldModel> CreateAsync(HelloWorldModel helloWorld) { await _eventHandler.HandleAsync(Mapper.Map <HelloWorldAddedEvent>(helloWorld)); return(helloWorld); }
void View_LoadText(object sender, EventArgs e) { //get the data from the model and sent it back to the method(s) you want to execute view.SetText(HelloWorldModel.DBData() + " It sure is a nice day."); }
public GetMessageServiceViewModel(ReceiveMessageModel valueMessage) { this.AmazonId = valueMessage.Id; Data = this.GetMessageObject(valueMessage.Body); }
public HelloWorldRepository() { helloWorld = new HelloWorldModel("Hello World"); }
public HelloWorldViewModel() { HelloWorldModel helloWorldModel = new HelloWorldModel(); helloString = helloWorldModel.ImportantInfo; }