Skip to main content

Dog food

Blue Buffalo is a premium dog food brand created by a family for their own beloved furry companion. Blue Buffalo offers nutritious recipes that include natural ingredients, high quality meat, fish or poultry, and fruits and vegetables. They produce healthy recipes for all stages of life, all sizes, and all activity levels. Introducing Blue Buffalo Bill and Jackie Bishop began to take an interest in pet health issues when their Airedale,Introducing Blue Buffalo Bill and Jackie Bishop began to take an interest in pet health issues when their    or all stages of life, all sizes, and all activity levels.      Airedale,

 



dotnet new mvc --auth none

HomeController.

using System;

using System.Collections.Generic;

using System.Diagnostics;

using System.Linq;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;

using Microsoft.Extensions.Logging;

using ma.Models;

namespace ma.Controllers

{ public class HomeController : Controller

 {public String Index()

 {return "Hello Deepak";

}}}

[dotnet run]

StockQuote.cs

using System;

namespace ma.Models

{

 public class StockQuote

 {

 public string Symbol {get;set;}

 public int Price{get;set;}

 }}

Ma/views/home/

Index.cshtml

@{

 ViewData["Title"] = "Home Page";

}

<div

 Symbol: @Model.Symbol <br/>

 Price: $@Model.Price <br/>

</div>

AGAIN controller:

using System;

using System.Collections.Generic;

using System.Diagnostics;

using System.Linq;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;

using Microsoft.Extensions.Logging;

using ma.Models;

namespace ma.Controllers

{

 public class HomeController : Controller

 {

 public async Task <IActionResult> Index()

 {

 var model=new StockQuote {Symbol="Hello", Price=3200};

 return View(model);

 }

 }

}

[dotnet run]

Building ASP.Net core REST API

[dotnet new webapi -o Glossary] (cmd 1)

[cd Glossary] [dotnet run] (cmd 1)

[curl –insecure https://localhost:7018/weatherforecast] (cmd 2)

ma2\Glossary\GlossaryItem.cs

//GlossaryItem.cs

namespace Glossary

{

 public class GlossaryItem

 {

 public string Term { get; set;}

 public string Definition { get; set;}

 }

}

Glossary\Controllers\ GlossaryController.cs

using System;

using System.Collections.Generic;

using Microsoft.AspNetCore.Mvc;

using System.IO;

namespace Glossary.Controllers

{

[ApiController]

[Route("api/[controller]")]

public class GlossaryController:ControllerBase

{

 private static List<GlossaryItem>Glossary=new List<GlossaryItem>

 {

 new GlossaryItem

 {

 Term="HTML", Definition="HyperText Markup language"

 },

 new GlossaryItem

 {

 Term="MVC", Definition="Model View Control"

 },

 new GlossaryItem

 {

 Term="OpenID", Definition="An Open Standard For Autehntication"

 }

 };

[HttpGet]

public ActionResult<List<GlossaryItem>>Get()

{

 return Ok(Glossary);

}

[HttpGet]

[Route("{term}")]

public ActionResult<GlossaryItem>Get(string term)

{

 var glossaryItem=Glossary.Find(item=>item.Term.Equals(term,StringComparison.InvariantCultureIgnoreCase));

 if(glossaryItem==null)

 {return NotFound();

 }else

 {

 return Ok(glossaryItem);

 }

}

[HttpPost]

public ActionResult Post(GlossaryItem glossaryItem)

{

var existingGlossaryItem=Glossary.Find(item=>item.Term.Equals(glossaryItem.Term,StringComparison.InvariantCultureIgnoreCase));

if (existingGlossaryItem!= null)

{

return Conflict("Cannnot create the term because it already exists");

}

else

{

 Glossary.Add(glossaryItem);

 var resourseUrl=Path.Combine(Request.Path.ToString(),Uri.EscapeUriString(glossaryItem.Term));

 return Created(resourseUrl,glossaryItem);

}

}

[HttpPut]

 public ActionResult Put(GlossaryItem glossaryItem)

 {

 var existingGlossaryItem=Glossary.Find(item=>item.Term.Equals(glossaryItem.Term,StringComparison.InvariantCultureIgnoreCase));

 if (existingGlossaryItem==null)

 {

 return BadRequest("Cannnot update a non existing Term");

 }

 else

 {

 existingGlossaryItem.Definition=glossaryItem.Definition;

 return Ok();

 }

 }

[HttpDelete]

[Route("{term}")]

public ActionResult Delete(string term)

{

 var glossaryItem=Glossary.Find(item=>item.Term.Equals(term,StringComparison.InvariantCultureIgnoreCase));

 if(glossaryItem==null)

 {

 return NotFound();

 }

 else

 {

 Glossary.Remove(glossaryItem);

 return NoContent();

 }

}

}

}

curl --insecure https://localhost:7018/api/glossary

Getting a single item

curl --insecure https://localhost:7018/api/glossary/MVC

Creating an Item:

curl --insecure -X PUT -d "{\"term\":\"MVC\",\"definition\":\"Modified record of Model View Controller.\"}" -H "Content-Type:application/json"

https://localhost:7018/api/glossary

Update Item:

curl --insecure -X PUT -d "{\"term\":\"MVC\",\"definition\":\"Modified record of Model View Controller.\"}" -H "Content-Type:application/json"

https://localhost:7018/api/glossary

Delete Item:

Command [ curl --insecure --request DELETE –url

Comments

Popular posts from this blog

Blue Buffalo Dog Foods Review, Recalls and Ingredients in 2022

  Blue Buffalo is a premium dog food brand created by a family for their own beloved furry companion. Blue Buffalo offers nutritious recipes that include natural ingredients, high quality meat, fish or poultry, and fruits and vegetables. They produce healthy recipes for all stages of life, all sizes, and all activity levels. Introducing Blue Buffalo Bill and Jackie Bishop began to take an interest in pet health issues when their Airedale, Blue, began to suffer from health issues.  This led them to develop Blue Buffalo Dog Food, which contained only the best natural ingredients to promote a strong immune system. Blue Buffalo dog food  does not contain any flour, wheat, corn or soy protein by-products, or artificial flavors, colors or preservatives  .  As far as I know, none of their recipes contain  dairy or egg  , either.  They produce two lines of grain-free dog food, one line with limited ingredients and one line "Life Protection" rich in antiox...

Tips and tricks for cutting your dog's Nails

Is it painful for you to cut your dog's claws?  This routine is often unpopular with animals because it is usually not done the right way.  Here are some tips for establishing a pleasant healing ritual between you and your companion. Why and how to cut the claws Clipping is essential for your dog's comfort and should be done on average every month.  However, be aware that your dog's age and medical condition have an impact on how often you cut.  Also, if your dog is active, some of the claws may wear down and you may not have to cut them as often. This treatment is very simple when the claws are transparent.  It becomes more complex when they are black.  In order not to hurt your dog, you must stop before the vein and the nerve.  When the claw is dark, we cut just before the small white point in the center.  So it takes some getting used to. The right tools and the right environment There are several models of dog  nail clippers  . ...