Esempio n. 1
0
        public ActionResult Create([Bind(Include = "Id,Title,Address,Phone")] Studio studio)
        {
            if (ModelState.IsValid)
            {
                ss.AddStudio(studio);
                return(RedirectToAction("Index"));
            }

            return(View(studio));
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public async Task <Studio> Post([FromBody] Studio value)
 {
     return(await studioService.AddStudio(value));
 }