using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using sql_pagining.models;
using Dapper;
using MySqlConnector;


namespace sql_pagining.models
{
    public class Product
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string ArticleNumber { get; set; }
        public int ProductTypeID { get; set; }
        public string ProductTypeTitle { get; set; }
        public double? MaterialCost { get; set; }
        public string? MaterialString { get; set; }
        public string? Image { get; set; }

        public Uri? ImageNaruto
        {
            get
            {
                var imageName = Environment.CurrentDirectory + (Image ?? "");
                return System.IO.File.Exists(imageName) ? new Uri(imageName) : null;
            }
        }
    }
}