public SquaresPage()
        {
            InitializeComponent();
            var colors = ColorsService.GetColors(25);

            BindingContext = new ObservableCollection <SquareColor>(colors);
        }
Пример #2
0
        private IColorsService GetColorsService()
        {
            var dbContext = this.GetUseInMemoryDbContext().GetAwaiter().GetResult();

            IRepository <Color> repository = new EfRepository <Color>(dbContext);

            IColorsService service = new ColorsService(repository);

            return(service);
        }
Пример #3
0
        public ColorsServiceTests()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options;

            this.dbContext = new ApplicationDbContext(options);

            this.colorsRepository = new EfRepository <Color>(this.dbContext);
            this.service          = new ColorsService(this.colorsRepository);
            AutoMapperConfig.RegisterMappings(Assembly.Load("CarsVision.Web.ViewModels"));
        }
Пример #4
0
 public ColorsController(ColorsService service)
 {
     _service = service;
 }