async Task AddCastAsync() { Cast c = new Cast(); Console.Write(" Enter Cast Name = "); c.Name = Console.ReadLine(); Console.Write("Enter Gender = "); c.Gender = Console.ReadLine(); Console.Write("Enter TmbdUrl = "); c.TmdbUrl = Console.ReadLine(); Console.Write("Enter ProfilePath = "); c.ProfilePath = Console.ReadLine(); int res = await castService.AddCastAsync(c); if (res > 0) { Console.WriteLine("Cast added successfully"); } else { Console.WriteLine("Some error has occurred"); } }
async Task AddCastAsync() { try { Cast c = new Cast(); Console.Write("Enter Name => "); c.Name = Console.ReadLine(); Console.Write("Enter Gender => "); c.Gender = Console.ReadLine(); Console.Write("Enter TmdbUrl => "); c.TmdbUrl = Console.ReadLine(); Console.Write("Enter ProfilePath => "); c.ProfilePath = Console.ReadLine(); int res = await castService.AddCastAsync(c); if (res > 0) { Console.WriteLine("Cast added successfully"); } else { Console.WriteLine("Some error occurs"); } } catch (Exception ex) { Console.WriteLine("some error has been occured. Contact the admin department"); } }