public ActorsController(sakilaContext context) { _context = context; }
public FilmTextController(sakilaContext context) { _context = context; }
public ActorsController(sakilaContext context) { actors = new ActorsRepository(context); }
static void Main(string[] args) { //List actors names and lastnames: var dbContext = new sakilaContext(); var actors = dbContext.Actor.ToList(); foreach (var a in actors) { System.Console.WriteLine($"ID:{a.ActorId} Name:{a.FirstName} {a.LastName}"); } //List films and their actors: // var dbContext = new sakilaContext(); // var records = dbContext.Film.Include(f => f.FilmActor).ThenInclude(r => r.Actor).ToList(); // foreach (var record in records) // { // System.Console.WriteLine($"Film: {record.Title}"); // var counter = 1; // foreach (var fa in record.FilmActor) // { // System.Console.WriteLine($"\tActor {counter++}: {fa.Actor.FirstName} {fa.Actor.LastName}"); // } // } //CREATE NEW VALUE ON db: // var dbContext = new sakilaContext(); // var city = new City() { CityId = 1001, Name = "Gdansk", CountryId = 103 }; // dbContext.Add(city); // dbContext.SaveChanges(); //Update record od the DB: // var dbContext = new sakilaContext(); // var uTarget = dbContext.City.SingleOrDefault(c => c.CityId == 1001); // if (uTarget != null) // { // uTarget.Name = "Sopot"; // change Name to City1 if you did not update the City class file // dbContext.Update(uTarget); // dbContext.SaveChanges(); // } //Delete record from DB: // var dbContext = new sakilaContext(); // var dTarget = dbContext.City.SingleOrDefault(c => c.CityId == 1001); // if (dTarget != null) // { // dbContext.Remove(dTarget); // dbContext.SaveChanges(); // } }
public ValuesController(sakilaContext dbContext, MappedSchemaProvider <sakilaContext> schemaProvider) { this._dbContext = dbContext; this._schemaProvider = schemaProvider; }
public AddressesController(sakilaContext context) { _context = context; }
public CourseController(sakilaContext context) { courses = new CoursesRepository(context); }
public RecordsController(sakilaContext context) { records = new RecordsRepository(context); }
public ActorRepository(sakilaContext context) { _context = context; }
public CustomersController(sakilaContext context) { _context = context; }
public TaskController(sakilaContext context) { _context = context; }
public RentalsController(sakilaContext context) { _context = context; }
public StoreService(sakilaContext context) { _context = context; }
public MovieRepository(sakilaContext context) { _context = context; }
public GradesController(sakilaContext context) { records = new RecordsRepository(context); students = new StudentRepository(context); courses = new CoursesRepository(context); }