Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers().AddNewtonsoftJson();

            var personRepository = new Repository <Person>();

            services.AddSingleton <IRepository <Person> >(personRepository);
            services.AddSingleton <IRepository <Film> >(new Repository <Film>());
            services.AddSingleton <IRepository <Planet> >(new Repository <Planet>());
            services.AddSingleton <IRepository <Vehicle> >(new Repository <Vehicle>());
            services.AddSingleton <IRepository <Starship> >(new Repository <Starship>());
            services.AddSingleton <IRepository <Specie> >(new Repository <Specie>());

            var relationshipHandler = new RelationshipHandler(personRepository);

            services.AddSingleton <IRelationshipHandler>(relationshipHandler);
        }
 public RelationshipHandlerTests()
 {
     _relationshipHandler = new RelationshipHandler();
 }
Ejemplo n.º 3
0
 public Operation(Kingdom kingdom)
 {
     this._kingdom             = kingdom;
     this._relationshipHandler = new RelationshipHandler();
 }