
using Microsoft.Data.SqlClient;

namespace Models;

public class Customer
{
    public required long Id { get; set; }
    public required string Name { get; set; }
    public required string Adress { get; set; }
    public required string DriverlicenseId { get; set; }

    public static Customer FromReader(SqlDataReader reader)
    {
        return new Customer
        {
            Id = (long)reader["id"],
            Name = (string)reader["name"],
            Adress = (string)reader["Adress"],
            DriverlicenseId = (string)reader["driverlicenseid"],
        };
    }
}