Пример #1
0
        // GET: Studio/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Studio studio = ss.GetStudioById(id);

            if (studio == null)
            {
                return(HttpNotFound());
            }
            return(View(studio));
        }
Пример #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();
        }