public ActionResult Create([Bind(Include = "Id,Title,Address,Phone")] Studio studio) { if (ModelState.IsValid) { ss.AddStudio(studio); return(RedirectToAction("Index")); } return(View(studio)); }
static void Main(string[] args) { var context = new MusicDbContextProvider(); StudioService ss = new StudioService(context); Studio a = new Studio { Id = 1, Title = "Sunny Records", Address = "Hollywood, 1", Phone = 88005553535 }; ss.AddStudio(a); a = ss.GetStudioById(1); Console.WriteLine(a.Title); Console.ReadKey(); }
public async Task <Studio> Post([FromBody] Studio value) { return(await studioService.AddStudio(value)); }