public SquaresPage() { InitializeComponent(); var colors = ColorsService.GetColors(25); BindingContext = new ObservableCollection <SquareColor>(colors); }
private IColorsService GetColorsService() { var dbContext = this.GetUseInMemoryDbContext().GetAwaiter().GetResult(); IRepository <Color> repository = new EfRepository <Color>(dbContext); IColorsService service = new ColorsService(repository); return(service); }
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")); }
public ColorsController(ColorsService service) { _service = service; }