public static Wholesaler ToModel(this WholesalerEntity entity) { return(new Wholesaler { Id = entity.Id, Name = entity.Name }); }
public int CreateWholesaler(WholesalerDTO wholesaler) { var wholesalerEntity = new WholesalerEntity { Name = wholesaler.Name, LogoUrl = wholesaler.LogoUrl }; return(_wholesalerRepository.Create(wholesalerEntity)); }
private WholesalerDTO ConvertToDTO(WholesalerEntity wholesaler) { if (wholesaler == null) { return(null); } //TODO: Use AutoMapper instead of custom mapping return(new WholesalerDTO { Id = wholesaler.Id, Name = wholesaler.Name, LogoUrl = wholesaler.LogoUrl }); }