Files
Articulate-ORM/Articulate/Model.cs
Ryan Palmer 72f1ccefca Start on QueryBuilder
Created:

- MySql Type Name Map
- Added String Extensions
2021-08-01 08:49:47 +10:00

59 lines
1.1 KiB
C#

using MySql.Data.MySqlClient;
using Pluralize.NET;
using System;
using System.Collections.Generic;
using System.Text;
namespace Articulate
{
public abstract class Model
{
protected virtual string Table => new Pluralizer().Pluralize(this.GetType().Name);
protected virtual string PrimaryKey => "id";
protected virtual MySqlDbType KeyType => MySqlDbType.Int32;
protected bool Incrementing = true;
protected bool Timestamps = false;
public Model()
{
}
public bool Insert()
{
return false;
}
public Model[] Get(params string[][] conditions)
{
string query = QueryBuilder.Select(this, conditions);
//DBConnection.Instance()
return null;
}
public string GetTable()
{
return Table;
}
public string GetPrimaryKey()
{
return PrimaryKey;
}
public MySqlDbType GetKeyType()
{
return KeyType;
}
public void Save()
{
//Insert into database;
}
}
}