Generic C# Repository, service and controller design

Im learning about generics and was wondering about how a generic controller, service and ef core repo design would look like. My case: lets say an incomming post request to add Smartphone and keyboard object to smartphone and keyboard tables My repository setup is public class GenericRepository<TEntity> : IGenericRepository<TEntity> where TEntity : class, IProductGenericEntities {… Read More Generic C# Repository, service and controller design

How to use `label_date_short`?

How I am using wrongly label_date_short from scales package? library(tidyverse) library(scales) date_taille <- tibble( Taille = rep(c("taille_hiver", "taille_ete"), times = 2), Date_taille = c("2016-08-01", "2016-02-01", "2018-08-01", "2018-02-01") %>% as.Date() ) ggplot(date_taille) + aes(x = Date_taille, y = Taille) + geom_point() + scale_x_date(date_breaks = "month", date_labels = label_date_short()) #or label_date() #> Error in format(x, format =… Read More How to use `label_date_short`?

Cannot get prevState from componentDidUpdate lifecycle hook in React.js v18.1.0

import React, { Component } from "react"; class Counter extends Component { constructor(props) { super(props); this.state = { counter: 1 }; } handleIncrement = () => { this.setState({ counter: this.state.counter + 1 }); }; componentDidUpdate(prevState) { console.log("prevState", prevState); } render() { return ( <React.Fragment> <p>{this.state.counter}</p> <button onClick={this.handleIncrement}>Increment</button> </React.Fragment> ); } } export default Counter; I… Read More Cannot get prevState from componentDidUpdate lifecycle hook in React.js v18.1.0